#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main()
{
    char word[20];
    fgets(word, sizeof(word), stdin);
    int len = strlen(word);
    for(int i = 0; i < len; i++)
    {
        if(isdigit(word[i]))
        {
            printf("Invalid input");
            return 0;
        }
        for(int s = 0; s < len - i - 1; s++)
        {
            printf("");
        }
        for(int j = 0; j <= i; j++)
        {
            printf("%c", word[j]);
            if(j < i)
            {
                printf(" ");
            }
        }
        printf("\n");
    }
    return 0;
}