Xenia the mathematician has a sequence consisting of n (n is divisible by 3) positive integers, each of them is at most 7. She wants to split the sequence into groups of three so that for each group of three a, b, c the following conditions held:

  * a < b < c; 
  * a divides b, b divides c. 



Naturally, Xenia wants each element of the sequence to belong to exactly one group of three. Thus, if the required partition exists, then it has <image> groups of three.

Help Xenia, find the required partition or else say that it doesn't exist.

Input

The first line contains integer n (3 ≤ n ≤ 99999) — the number of elements in the sequence. The next line contains n positive integers, each of them is at most 7.

It is guaranteed that n is divisible by 3.

Output

If the required partition exists, print <image> groups of three. Print each group as values of the elements it contains. You should print values in increasing order. Separate the groups and integers in groups by whitespaces. If there are multiple solutions, you can print any of them.

If there is no solution, print -1.

Examples

Input

6
1 1 1 2 2 2


Output

-1


Input

6
2 2 1 1 4 6


Output

1 2 4
1 2 6
import collections as coll

groups,impossible = [],False
n,nums = int(input()), coll.Counter(map(int,input().split(" ")))
x = n // 3
for x in range(x):
    group = []
    if nums[1] != 0:
        group.append(1)
        nums[1] -= 1
    else: 
        impossible = True
        break
    if nums[2] != 0:
        group.append(2)
        nums[2] -= 1
        if nums[4] != 0:
            group.append(4)
            nums[4] -= 1
        elif nums[6] != 0:
            group.append(6)
            nums[6] -= 1
        else: 
            impossible = True 
            break
    elif nums[3] != 0 and nums[6] != 0:
        group.append(3)
        group.append(6)
        nums[3] -= 1
        nums[6] -= 1
    else:
        impossible = True
        break
    groups.append(group)
if impossible: print(-1)
else:
    for group in groups:
        print(*group)






'''
the numbers which we get on the input
should be at most 7. It means that if we have at least one 7 or 5
on our input, it is impossible to create a required partition since 
7 and 5 are primes. And they are not divisors because max is 7, and numbers cannot
be the same in one group.
a < b < c. (without this condition something like that could exists 1,1,7, 5,5,5)
a | b && b | c
If 'n' is always divisible by 3. It means that we have to use every signle number.

6,4,3,2,1 (valid divisors: 3,2,1)

Since numbers are at most 7, we have very limited amount of groups which are vaild for these
conditions: (Every group should start from 4 or 6, otherwise it's impossible to satisfy parititon)
1,2,4
1,2,6
1,3,6

wystarczy sprawdzic ilosc liczb
suma ilosci czworek i szostek musi dac liczbe grup poniewaz wszystkie musza 
sie konczyc na 6 albo 4. Liczba jedynek musi byc tyle samo co grup.
Oraz liczba 2 i 3: 
odkad wszystkie musza sie zaczynac na 1 biorac pod uwage warunki.
I mozna pojsc od jedynek w takim razie przy konstrukcji,
jezeli do niej dojdziemy tzn ze mozemy stworzyc te grupy
1 - 2 - 4
1 - 2 - 6
1 - 3 - 6
Jezeli w grupie bedzie jakas 5,7 albo za duzo czegos lub za malo tzn ze niemozliwe
spelnienie warunkow.
'''