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