n = int(input()) A, B = [], [] for i in range(n): A.append(3 * i) B.append(7 + 3 * i) if n % 3 == 1: A[0] += 1 elif n % 3 == 2: A[0] += 1 A[1] += 1 res = sum(B) - sum(A) i = n - 1 while res > 0: A[i] += 3 res -= 3 i = (i - 1) % n print(*A) print(*B)