a = int(input()) t = '' for i in range(a): for j in range(a): t+=str((j+1)%10) print(t)