s=int(raw_input()) for x in range(1,s+1): print '1'*s if x == 1 or x == s else '1'+('0'*(s-2))+'1'