## https://yukicoder.me/problems/no/1837 def main(): N = int(input()) if N % 3 == 1: A = [] for i in range(N): A.append(3 * i) B = [] for i in range(N): B.append(3 * i + 1) A[0] = N A.sort() print(" ".join(map(str, A))) print(" ".join(map(str, B))) elif N % 3 == 2: A = [] for i in range(N): A.append(3 * i) B = [] for i in range(N): B.append(3 * i + 2) A[0] = 2 * N A.sort() print(" ".join(map(str, A))) print(" ".join(map(str, B))) else: # N % 3 == 0: A = [] for i in range(N): A.append(3 * i) B = [] for i in range(N): B.append(3 * i + 1) n = N // 3 for i in range(n): A[- i - 1] += 3 print(" ".join(map(str, A))) print(" ".join(map(str, B))) if __name__ == "__main__": main()