while True: try: x = int(input()) for i in range(1,x+1): for j in range(1,x+2-i): if j == x+1-i: ...