#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main()
{
    char str[100];
    int i, j, k, len, spaces; 
    scanf("%s", str);
    for( int i = 0; i< strlen(str); i++)
    {
        if(!isdigit(str[i]))
        {
        printf("Invalid input\n");
        return 0;
    }
    len = strlen(str);
    if(len == 0)
    {
        printf("Invalid input");
        return 0;
    }
    for (int i = 1; i <= len; i++)
    {
        for(spaces = 0; spaces < len - 1 - i; spaces++)
        {
            printf(" ");
        } 
        for( j = 0; j < i-1; j++)
        {
            printf("%c",str[j]);
            if(j <= i - 1)
            {
                printf(" ");
            }
        }
         printf("\n");
        }
        return 0;
}