n = int(input()) A = [] B = [] m = n // 3 for i in range(m): A.append(9 * i + 3) A.append(9 * i + 6) A.append(9 * i + 9) B.append(3 * i + 1) for i in range(2 * m): B.append(3 * m + 3 * i + 4) if n % 3 == 1: b = B[-1] B[-1] += 3 B.append(b + 6) A.append(b + 9) else: A[-1] += 3 A.append(9985) B.append(9991) B.append(9994) A.append(9997) print(*A) print(*B) assert sum(A) == sum(B) assert max(A) <= 10000 assert max(B) <= 10000 se = set() for i in range(n): for j in range(i + 1, n): se.add(A[i] + A[j]) for i in range(n): for j in range(i + 1, n): assert B[i] + B[j] not in se, (B[i] + B[j])