#include <stdio.h>
int flag = 0;
void DrawTreeBody(int n)
{
    flag++;
    if (n > 1)
    {
        DrawTreeBody(n -1);
    }
    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < (3 * (flag)) - i - 1; j++)
        {
            printf(" ");
        }
        for (int z = 0; z < n; z++)
        {
            for (int k = 0; k <= i; k++)
            {
                printf("* ");
            }
            for (int l = 0; l < 5 - (i * 2) -1; l++)
            {
                printf(" ");
            }
        }
        printf("\n");
    }
    flag--;
}
void DrawTreeFoot(int n)
{
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < 3 * n - 1; j++)
        {
            printf(" ");
        }

        printf("*\n");
    }
}
int main() {
    int num = 0;
    while (scanf("%d", &num) != EOF) 
    { 
        DrawTreeBody(num);
        DrawTreeFoot(num);
    }
    return 0;
}