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