import sys,random,bisect from collections import deque,defaultdict from heapq import heapify,heappop,heappush from itertools import permutations from math import log,gcd input = lambda :sys.stdin.readline() mi = lambda :map(int,input().split()) li = lambda :list(mi()) N = int(input()) if N%3==0: A = [3*i for i in range(N)] + [10001] B = [3*i+1 for i in range(N)] tmp = N for i in range(N)[::-1]: while tmp and A[i]+3 < A[i+1]: A[i] += 3 tmp -= 3 assert tmp == 0 print(*A[:N]) print(*B) elif N%3==1: A = [3*i for i in range(N)] + [10001] B = [3*i+1 for i in range(N)] tmp = N - 1 A[-2] += 1 for i in range(N)[::-1]: while tmp and A[i]+3 < A[i+1]: A[i] += 3 tmp -= 3 assert tmp==0 print(*A[:N]) print(*B) else: A = [3*i for i in range(N)] + [10001] B = [3*i+1 for i in range(N)] tmp = N - 2 A[-2] += 1 A[-3] += 1 for i in range(N)[::-1]: while tmp and A[i]+3 < A[i+1]: A[i] += 3 tmp -= 3 assert tmp==0 print(*A[:N]) print(*B)