#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");
            return 0;
        }
    }
    len =strlen(str);
    if(len == 0){
        printf("Invalid input");
        return 0;
    }
    for ( i = 0; i < len; i++){
        for(spaces = 0;spaces < len-1-i; spaces++){
            printf(" ");
        }
        for( j = 0; j < =i; j++ ){
            printf("%c",str[j])
            if(j <= i - 1 ){
                printf(" ");
            }
        }
        printf("\n");
    }
    return 0;
}