#include <iostream>
using namespace std;
int main() {
    char c;
    cin >> c;
    if(c >= 'A' && c <= 'Z') {
        for(int i = 1; i <= c - 'A' + 1 - i; i++) {
            for(int j = 1; j <= c - 'A'; j++) {
                cout << " ";
            }
            for(int j = 1; j <= i; j++) {
                cout << (char)('A' + j - 1);
            }
            for(int j = i - 1; j >= 1; j--) {
                cout << (char)('A' + j - 1);
            } 
            cout << endl;
        }
    } else {
        for(int i = 1; i<= c - '1' + 1; i++) {
            for(int j = 1; j <= c - '1' + 1 - i; j++) {
                cout << " ";
            }
            for(int j = 1; j <= i; j++) {
                cout << (char)('1' + j - 1);
            }
            for(int j = i - 1; j >= 1; j--) {
                cout << (char)('1' + j - 1);
            } 
            cout << endl;
        }
    }
    return 0;
}