#include <stdio.h>

void printNumberPattern(int n) {
    int totalRows = n * 2 - 1;
    int totalCols = totalRows;
    for (int i = 0; i < totalRows; i++) {
        for (int j = 0; j < totalCols; j++) {
            
            if (i <= n - 1) {
                if (j < i) {
                    printf("%d", n - j); 
                } else if (j >= totalCols - i) {
                    printf("%d", n - (totalCols - j - 1)); 
                } else {
                    printf("%d", n - i); 
                }
            } else {
                
                int mirroredRow = totalRows - i - 1; 
                if (j < mirroredRow) {
                    printf("%d", n - j); 
                } else if (j >= totalCols - mirroredRow) {
                    printf("%d", n - (totalCols - j - 1)); 
                } else {
                    printf("%d", n - mirroredRow); 
                }
            }
        }
        printf("\n"); 
    }
}

int main() {
    int n;
    if (scanf("%d", &n) != 1 || n < 1) {  
        printf("Invalid Input\n");
        return 0; 
    }
    printNumberPattern(n);
    return 0;
}