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.

Difficulty: EASY

Solutions:
n = int(input().strip())
if n % 2 == 0:
	print('-1')
else:
	ans = ' '.join(map(str, range(n)))
	print(ans)
	print(ans)
	print(' '.join(map(str, [(i + i) % n for i in range(n)])))


n = int(input())
if n % 2 == 0:
	print('-1')
else:
	a = range(n)
	print(' '.join(map(str, a)))
	print(' '.join(map(str, a)))
	print(' '.join(map(lambda x: str((x[0] + x[1]) % n), zip(a, a))))


n = int(input())
if n % 2 == 0:
	print(-1)
	exit()
print(*range(n))
print(*range(n))
res = []
for i in range(n):
	res += [2 * i % n]
print(*res)


n = int(input())
if n % 2 == 0:
	print('-1')
else:
	A = []
	C = []
	for i in range(n):
		A.append(i)
		C.append(2 * i % n)
	print(*A)
	print(*A)
	print(*C)


from sys import stdin as read
from sys import stdout as out
n = int(read.readline())
if n % 2 == 0:
	out.write('-1')
else:
	res = ' '.join(map(str, range(n)))
	out.write(res + '\n')
	out.write(res + '\n')
	out.write(' '.join(map(str, [(i + i) % n for i in range(n)])))


n = int(input())
arr = [i for i in range(n)]
ans = []
for i in range(n):
	ans.append(2 * i % n)
if sorted(ans) != arr:
	print(-1)
else:
	print(*arr)
	print(*arr)
	print(*ans)


n = int(input())
if n % 2 == 0:
	print(-1)
else:
	a = ['{}'.format(i) for i in range(n)]
	b = ['{}'.format(i) for i in range(n)]
	c = ['{}'.format((int(a[i]) + int(b[i])) % n) for i in range(n)]
	print(' '.join(a))
	print(' '.join(b))
	print(' '.join(c))


n = int(input())
if n % 2 == 0:
	print(-1)
else:
	a = ' '.join((str(x) for x in range(n)))
	print(a)
	print(a)
	print(' '.join((str(x) for x in range(0, n, 2))), ' '.join((str(x) for x in range(1, n, 2))))


from functools import reduce
import os
import sys
from collections import *
from decimal import *
from math import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [str(i) for i in input()]

def starr():
	return [str(x) for x in input().split()]

def inn():
	return int(input())

def svalue():
	return tuple(map(str, input().split()))

def parr():
	return [value() for i in range(n)]

def Ceil(a, b):
	return a // b + int(a % b > 0)
albhabet = 'abcdefghijklmnopqrstuvwxyz'
mo = 1000000007
inf = 1e+18
div = 998244353
n = inn()
if n % 2 == 1:
	print(*[i for i in range(0, n)])
	print(*[i for i in range(0, n)])
	for i in range(n):
		print((i + i) % n, end=' ')
	print()
else:
	print(-1)


import os
import sys
from io import BytesIO, IOBase
import math
mod = int(1000000000.0 + 7)

def main():
	n = int(input())
	if n % 2 == 0:
		print(-1)
		return
	print(*[x for x in range(0, n)])
	print(*[x for x in range(0, n)])
	print(*[(x + x) % n for x in range(0, n)])
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def main():
	n = int(input())
	p1 = [i for i in range(n)]
	p2 = [i for i in range(n)]
	check = [False] * n
	p = [i for i in range(n)]
	ok = True
	for i in range(n):
		ind = (p1[i] + p2[i]) % n
		if not check[ind]:
			check[ind] = True
		else:
			ok = False
			break
		p[i] = ind
	if ok:
		print(*p1)
		print(*p2)
		print(*p)
	else:
		print(-1)
main()


import sys
input = sys.stdin.readline
from math import log2, log, ceil

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return res

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
n = int(input())
a = []
for i in range(n):
	a.append(i)
if n % 2 == 0:
	print(-1)
else:
	print(*a)
	print(*a)
	c = []
	for i in range(n):
		c.append((i + i) % n)
	print(*c)


import random
t = 1
for _ in range(t):
	n = int(input())
	if n % 2 == 1:
		a = [i for i in range(n)]
		b = a
		c = [(a[i] + b[i]) % n for i in range(n)]
		print(*a)
		print(*b)
		print(*c)
	else:
		print(-1)


import math
import sys

def In():
	return map(int, sys.stdin.readline().split())

def luckyperm():
	n = int(input())
	if not n % 2:
		print(-1)
		return
	other = []
	l = []
	for i in range(n):
		l.append(i)
		other.append((i + i) % n)
	print(*l)
	print(*l)
	print(*other)
luckyperm()


n = int(input())
if n & 1:
	(lis1, lis2) = [[x for x in range(n)] for i in range(2)]
	lis3 = [lis1[i] * 2 % n for i in range(n)]
	print(*lis1)
	print(*lis2)
	print(*lis3)
else:
	print(-1)


n = int(input())
if n % 2 == 0:
	print(-1)
	exit()
print(*range(0, n))
print(*range(0, n))
for x in range(n):
	print(2 * x % n, end=' ')
print()


n = int(input())
if n % 2 == 0:
	print(-1)
else:
	print(*range(n))
	print(*range(n))
	print(*map(lambda x: x * 2 % n, range(n)))


n = int(input())
if n % 2 == 0:
	print('-1')
	exit(0)
a = []
b = []
c = [0] * n
for i in range(n):
	a.append(i)
	b.append(i)
for i in range(n):
	c[i] = (a[i] + b[i]) % n
print(*a)
print(*b)
print(*c)


n = int(input())
if n % 2 == 0:
	print(-1)
	exit()
a = list(range(n))
b = a
c = []
for i in range(n):
	c.append((a[i] + b[i]) % n)
a = map(str, a)
b = map(str, b)
c = map(str, c)
print(' '.join(a))
print(' '.join(b))
print(' '.join(c))


def main():
	n = int(input())
	if n % 2 == 0:
		print(-1)
		return
	a = list(range(n))
	c = [(e + e) % n for e in a]
	print(*a)
	print(*a)
	print(*c)
	return
main()


from bisect import *
import math
from collections import *
from heapq import *
from itertools import *
inf = 10 ** 18
mod = 10 ** 9 + 7
n = int(input())
if n % 2 == 0:
	print(-1)
	exit()
a = [i for i in range(n)]
b = [i for i in range(n)]
c = []
for i in range(n):
	temp = a[i] + b[i]
	c.append(temp % n)
print(*a)
print(*b)
print(*c)


n = int(input())
if n % 2 == 1:
	print(*range(n))
	print(*range(n))
	print(*[(x + y) % n for (x, y) in zip(range(n), range(n))])
else:
	print(-1)


n = int(input())
if n % 2 == 1:
	a = [i for i in range(n)]
	a = map(str, a)
	c = [2 * i % n for i in range(n)]
	c = map(str, c)
	a = ' '.join(a)
	print(a)
	print(a)
	print(' '.join(c))
else:
	print(-1)


n = int(input())
if n & 1:
	print(*list(range(n)))
	print(*list(range(n)))
	print(*[2 * i % n for i in range(n)])
else:
	print(-1)


n = int(input())
a = []
b = []
c = []
for i in range(n):
	a.append(i)
	b.append(i)
used = [0] * n
can = True
for i in range(n):
	c.append((a[i] + b[i]) % n)
	if used[c[i]]:
		can = False
		break
	used[c[i]] = 1
if can == False:
	print('-1')
	exit()
print(' '.join(map(str, a)))
print(' '.join(map(str, b)))
print(' '.join(map(str, c)))


from sys import stdin, stdout
input = stdin.readline

def write(n, sep='\n'):
	stdout.write(str(n))
	stdout.write(sep)

def gil():
	return list(map(int, input().split()))
n = int(input())
if n % 2 == 0:
	print(-1)
else:
	p = list(range(n))
	print(*p)
	print(*p)
	for i in range(n):
		print(i * 2 % n, end=' ')
	print()


import sys
lines = sys.stdin.readlines()
N = int(lines[0].strip())
if N % 2 == 0:
	print(-1)
else:
	res = ''
	for i in range(N):
		res += str(i) + ' '
	print(res[:-1])
	print(res[:-1])
	l = [i * 2 % N for i in range(N)]
	l = list(map(str, l))
	print(' '.join(l))


from math import ceil, sqrt, gcd, log, floor
from collections import deque

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def li():
	return list(mi())

def msi():
	return map(str, input().strip().split(' '))

def lsi():
	return list(msi())
n = ii()
if n % 2 == 0:
	print('-1')
else:
	a = []
	b = []
	c = []
	for i in range(n):
		a.append(i)
		b.append(i)
		c.append((i + i) % n)
	print(*a)
	print(*b)
	print(*c)


n = int(input())
if n % 2 == 0:
	print(-1)
else:
	lista = list(range(n))
	saida = list(map(lambda x: 2 * x % n, lista))
	print(' '.join(map(str, lista)))
	print(' '.join(map(str, lista)))
	print(' '.join(map(str, saida)))


from itertools import zip_longest
n = int(input())
a = list(range(n))
b = list(range(n))
c = []
for (i, j) in zip_longest(a, b):
	c.append((i + j) % n)
if len(c) != len(set(c)):
	print(-1)
else:
	print(*a)
	print(*b)
	print(*c)


n = int(input())
if n % 2 != 0:
	lis = [i for i in range(n)]
	ans = [(i + i) % n for i in range(n)]
	print(*lis)
	print(*lis)
	print(*ans)
else:
	print(-1)


n = int(input())
if n % 2 == 0:
	print(-1)
else:
	l = []
	for i in range(n):
		l.append(i)
	print(*l)
	print(*l)
	for i in range(n):
		l[i] = 2 * l[i] % n
	print(*l)


n = int(input())
if n % 2 == 0:
	print(-1)
else:
	a = list(range(n))
	print(*a)
	print(*a)
	print(*a[::2] + a[1::2])


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
n = Int()
c = [i for i in range(n)]
if not n % 2:
	print(-1)
	exit()
print(*c)
print(*c)
print(*[2 * i % n for i in c])