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
//Date: Oct 12, 2013 
//Time: 3:56:55 PM

import java.util.*;
import java.io.*;

public class A342 implements Runnable {

	public void solve() throws IOException {
		int N = nextInt();
		int[] a = new int[8];
		for(int i = 0; i < N; i++) a[nextInt()]++;
		
		if(a[1] + a[2] + a[3] + a[4] + a[6] == N && a[1] == a[2] + a[3] && a[1] == a[4] + a[6] && a[3] <= a[6]){
				while(a[3] > 0){
					System.out.println("1 3 6");
					a[3]--;
					a[6]--;
				}
				while(a[4] > 0){
					System.out.println("1 2 4");
					a[4]--;
					a[2]--;
				}
				while(a[6] > 0){
					System.out.println("1 2 6");
					a[6]--;
					a[2]--;
				}
			}
		else System.out.println(-1);
	}

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	//-----------------------------------------------------------
	public static void main(String[] args) {
		new A342().run();
	}

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			tok = null;
			solve();
			in.close();
		} catch (IOException e) {
			System.exit(0);
		}
	}

	public String nextToken() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	BufferedReader in;
	StringTokenizer tok;
}
/**
public class A342 {

}
 
*/