g=[" "*(7-i)+"".join(map(str,range(1,1+i)))+str(i+1)*4for i in range(8)] for l in g+[g[-1]]*6+g[::-1]:print(l+l[::-1].strip())