N = int(input()) A = [] B = [] if N % 3 == 1: A.append(0) B.append(0) N -= 1 for i in range(1,N+1): A.append(i * 3) B.append(i * 3 + 2) A[-1] += 2 * N for i in A: print(i,end = " ") print() for i in B: print(i,end = " ") print()