import sys #input = sys.stdin.readline #文字列につけてはダメ input = sys.stdin.buffer.readline #文字列につけてはダメ #sys.setrecursionlimit(1000000) #import bisect #import itertools #import random #from heapq import heapify, heappop, heappush #from collections import defaultdict #from collections import deque #import copy #import math #from functools import lru_cache #@lru_cache(maxsize=None) #MOD = pow(10,9) + 7 #MOD = 998244353 #dx = [1,0,-1,0] #dy = [0,1,0,-1] def main(): N = int(input()) A = []; B = [] if N%3 == 0: for i in range(N): A.append(3*i+3) B.append(3*i+4) B.pop() B.append(2*N+1) B.sort() elif N%3 == 1: for i in range(N): A.append(3*i+3) B.append(0) for i in range(N-2): B.append(3*i+7) B.append(2*N+5) B.sort() else: for i in range(N): A.append(3*i+9) B.append(0) B.append(3) for i in range(N-3): B.append(3*i+17) B.append(N+33-3) B.sort() #print(sum(A),sum(B)) print(*A) print(*B) if __name__ == '__main__': main()