Bike is interested in permutations. A permutation of length n is an integer sequence such that each integer from 0 to (n - 1) appears exactly once in it. For example, [0, 2, 1] is a permutation of length 3 while both [0, 2, 2] and [1, 2, 3] is not.

A permutation triple of permutations of length n (a, b, c) is called a Lucky Permutation Triple if and only if <image>. The sign ai denotes the i-th element of permutation a. The modular equality described above denotes that the remainders after dividing ai + bi by n and dividing ci by n are equal.

Now, he has an integer n and wants to find a Lucky Permutation Triple. Could you please help him?

Input

The first line contains a single integer n (1 ≤ n ≤ 105).

Output

If no Lucky Permutation Triple of length n exists print -1.

Otherwise, you need to print three lines. Each line contains n space-seperated integers. The first line must contain permutation a, the second line — permutation b, the third — permutation c.

If there are multiple solutions, print any of them.

Examples

Input

5


Output

1 4 3 2 0
1 0 2 4 3
2 4 0 1 3


Input

2


Output

-1

Note

In Sample 1, the permutation triple ([1, 4, 3, 2, 0], [1, 0, 2, 4, 3], [2, 4, 0, 1, 3]) is Lucky Permutation Triple, as following holds:

  * <image>; 
  * <image>; 
  * <image>; 
  * <image>; 
  * <image>. 



In Sample 2, you can easily notice that no lucky permutation triple exists.
#codeforces div-3 round

'''for _ in range(int(input())):
    x=input()
    n=len(x)
    if x[0]=="1":
        print(n*(n+1)//2)
    else:
        print((int(x[0])-1)*10+n*(n+1)//2)'''

'''for _ in range(int(input())):
    n=int(input())
    arr=[int(i) for i in input().split()]
    
    ans=0
    last_seen=-1
    for k in range(n):
        if arr[k]!=0:
            if last_seen==-1:
                last_seen=k
            else:
                ans+=k-last_seen-1
                last_seen=k

    print(ans)'''

'''for _ in range(int(input())):
    n=int(input())
    arr=[int(i) for i in input().split()]

    ans=-1
    t=max(arr)
    for i in range(n):
        if (i>0 and arr[i]>arr[i-1]) or (i<n-1 and arr[i]>arr[i+1]):
            if arr[i]==t:
                ans=i+1
                break

    print(ans)'''
'''from collections import defaultdict
for _ in range(int(input())):
    n=int(input())
    arr=[int(i) for i in input().split()]
    cnt=defaultdict(int)
    for i in range(n):
        cnt[arr[i]]+=1

    less=min(cnt,key=lambda x:cnt[x])


    ans=1
    if len(cnt)==1:
        ans=-1
    rem=[]
    for i in range(n):
        if arr[i]!=less:
            rem.append(i)

    have=-1
    for i in range(n):
        if arr[i]==less:
            have=i
            break


    edges=[]
    for i in range(n):
        if i!=have:
            if arr[i]!=less:
                edges.append([i+1,have+1])
            else:
                if not rem:
                    ans=-1
                    break
                else:
                    a=rem.pop()
                    edges.append([i+1,a+1])

    if ans!=-1:
        print("YES")
        for k in edges:
            print(*k)
    else:
        print("NO")'''
        
'''def finder(arr,a):
    tot=sum(arr)
    dp=[float('inf') for _ in range(tot+1)]
    dp[0]=0
    for k in range(1,tot+1):
        for j in range(m):
            if k-arr[j]>=0:
                dp[k]=min(dp[k],dp[k-arr[j]]+1)
    print(dp)
    for t in range(tot,-1,-1):
        if dp[t]<=m//2 and t%a==0:
            return t
    return 0
n,m,k=[int(i) for i in input().split()]
ans=0
for i in range(n):
    
    ans+=finder([int(i) for i in input().split()],k)
    print(ans)

print(ans)'''

'''for _ in range(int(input())):
    n=int(input())
    s=input()

    dp1=[0 for i in range(n)]

    dp1[0]=int(s[0])
    for i in range(1,n):
        if s[i]=="1":
            if s[i-1]=="1":
                dp1[i]=dp1[i-1]+1
            else:
                dp1[i]=1
    dp2=[0 for i in range(n)]
    dp2[0]=1 if s[i]=="0" else 0
    for i in range(1,n):
        if s[i]=="0":
            if s[i-1]=="0":
                dp2[i]=dp2[i-1]+1
            else:
                dp2[i]=1

    ans=max(dp1,dp2)-1

    print(ans)'''
'''from collections import defaultdict
for _ in range(int(input())):
    n=int(input())
    arr=[int(i) for i in input().split()]

    cnt=defaultdict(int)
    arr.sort()
    for i in arr:
        cnt[i]+=1

    ans=0 
    available=set()
    for key,val in cnt.items():
        gap=0
        while val:
            if key-gap>0 and key-gap not in available:
                ans+=gap
                available.add(key-gap) 
                val-=1  
            elif key+gap not in available:
                ans+=gap
                available.add(key+gap)
                gap+=1
                val-=1
            else:
                gap+=1
        print(key,ans,available)
    
    print(available)

        
    print(ans)'''


n=int(input())

if n%2==0:
    print(-1)
else:
    a=[i for i in range(n)]
    b=[i for i in range(n)]
    c=[(a[i]+b[i])%n for i in range(n)]
    print(*a)
    print(*b)
    print(*c)
    






                
    
