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) elif n % 3 == 2: A[-1] += 3 A.append(9982) B.append(9988) B.append(9994) A.append(9997) A.sort() B.sort() exit() print(*A) print(*B) assert len(A) == n assert len(B) == n assert len(set(A)) == n assert len(set(B)) == n 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, n): se.add(A[i] + A[j]) for i in range(n): for j in range(i, n): assert B[i] + B[j] not in se, (B[i] + B[j])