import sys t = "PYTHON" for i in range(len(t)): for j in range(len(t)): sys.stdout.write(t[(i+j)%len(t)]+" ") print