P1498 Nanman Totem

Background

Since arriving in the land of the Nanman, Kongming not only subdued Meng Huo, but also discovered much wisdom among the ethnic minorities. He noticed that their totems often exhibit a fractal effect. After learning from the chieftain, he mastered many drawing techniques, but still could not draw their totem. So he sought help from your grandpa’s grandpa’s grandpa’s grandpa… As the grandchild’s grandchild’s grandchild’s grandchild…, can you do it?

Description

Given a positive integer $n$, refer to the sample output and print the pattern.

Input Format

Each test contains a single positive integer $n$, representing the totem’s size.

Output Format

Output the totem of size $n$.

Explanation/Hint

Constraints: $1 \leq n \leq 10$. Translated by ChatGPT 5