x = [] while True: i = int(input()) if i == 0: break x.append(i) for j in x: for n in range(1 , j + 1): print(n, end=' ') if n == j: print()