n = int(input()) S = [[-1]*n for i in range(n)] for i in range(n): for j in range(n): if i+j < n-1: S[i][j] = '0' elif i+j == n-1: if i <= n//2-1: S[i][j] = '1' else: S[i][j] = '2' else: S[i][j] = '2' for i in range(n): print(''.join(S[i]))