n=int(input()) a=[] b=[] asum=0 bsum=0 s=1 if n%3==2: s=2 for i in range(n): a.append(3*i) asum+=3*i b.append(3*i+s) bsum+=3*i+s a[n-1]+=bsum-asum print(*a) print(*b)