Limits 3s, 512 MB

Everybody knows about binary tree, a binary tree is a tree data structure in which each node has at most two children.

A Binary tree is Perfect Binary Tree in which all internal nodes have two children and all leaves are at same level. Here are some examples of perfect binary tree

Now your task is to draw perfect binary tree. You will be given NN which is the number of nodes of a perfect binary tree. Suppose NN is 3 then you have to print like first sample output, if NN is 7 You have to print like second sample output where node of a tree will be printed as capital 'O' and gaps before a node will be printed as hyphen '-'. You can assume that the value of NN will be valid always.

Input

Each line of input will contain NN (1N100001 \le N \le 10000). Input will be terminated by end of file.

Output

For each value of NN you have to print a perfect binary tree according to rules mentioned above. Print a blank line after each test case.

Sample

InputOutput
3
7
-O
O-O

---O
-O---O
O-O-O-O


Submit

Login to submit.

Statistics

97% Solution Ratio
nayeemahmed24Earliest, Jan '18
nusuBotFastest, 0.0s
nayeemahmed24Lightest, 262 kB
mdvirusShortest, 290B
Toph uses cookies. By continuing you agree to our Cookie Policy.