n=int(input()) a=[] b=[] diff=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) diff-=3*i+p b.append(3*i+s) diff+=3*i+s for i in range(n-1,0,-1): a[i]+=3 diff-=3 if diff<=3: break a[n-1]+=diff print(*a) print(*b)