Problem: A programming coach has n students to teach. We know that n is divisible by 3. Let's assume that all students are numbered from 1 to n, inclusive.

Before the university programming championship the coach wants to split all students into groups of three. For some pairs of students we know that they want to be on the same team. Besides, if the i-th student wants to be on the same team with the j-th one, then the j-th student wants to be on the same team with the i-th one. The coach wants the teams to show good results, so he wants the following condition to hold: if the i-th student wants to be on the same team with the j-th, then the i-th and the j-th students must be on the same team. Also, it is obvious that each student must be on exactly one team.

Help the coach and divide the teams the way he wants.

Input

The first line of the input contains integers n and m (3 ≤ n ≤ 48, <image>. Then follow m lines, each contains a pair of integers ai, bi (1 ≤ ai < bi ≤ n) — the pair ai, bi means that students with numbers ai and bi want to be on the same team.

It is guaranteed that n is divisible by 3. It is guaranteed that each pair ai, bi occurs in the input at most once.

Output

If the required division into teams doesn't exist, print number -1. Otherwise, print <image> lines. In each line print three integers xi, yi, zi (1 ≤ xi, yi, zi ≤ n) — the i-th team. 

If there are multiple answers, you are allowed to print any of them.

Examples

Input

3 0


Output

3 2 1 


Input

6 4
1 2
2 3
3 4
5 6


Output

-1


Input

3 3
1 2
2 3
1 3


Output

3 2 1 

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;
 
import static java.lang.Math.*;

public class Cf293 implements Runnable 
{
	static class InputReader 
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
		private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		public InputReader(InputStream stream) 
		{
			this.stream = stream;
		}
		
		public int read()
		{
			if (numChars==-1) 
				throw new InputMismatchException();
            
			if (curChar >= numChars) 
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}
                
				if(numChars <= 0)               
					return -1;
			}
			return buf[curChar++];
		}
     
		public String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}	
			return str;
		}
		public int[] nextArray(int n)
		{
			int arr[] = new int[n];
			int i;
			for(i=0;i<n;i++)
			{
				arr[i] = nextInt();
			}
			return arr;
		}
		public int nextInt() 
		{
			int c = read();
            
			while(isSpaceChar(c)) 
				c = read();
		
			int sgn = 1;
        
			if (c == '-') 
			{
				sgn = -1;
				c = read();
			}
            
			int res = 0;
			do
			{
				if(c<'0'||c>'9') 
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c)); 
        
			return res * sgn;
		}
        
		public long nextLong() 
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			long res = 0;
			
			do 
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}	
			while (!isSpaceChar(c));
				return res * sgn;
		}
		
		public double nextDouble() 
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.') 
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.') 
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c))
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}
    
		public String readString() 
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do 
			{
				res.appendCodePoint(c);
				c = read();
			} 
			while (!isSpaceChar(c));
            
			return res.toString();
		}
     
		public boolean isSpaceChar(int c) 
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
     
		public String next()
		{
			return readString();
		}
        
		public interface SpaceCharFilter
		{
			public boolean isSpaceChar(int ch);
		}
	}
	public static void main(String args[]) throws Exception 
	{
		new Thread(null, new Cf293(),"Main",1<<27).start();
	}	
	
	public static ArrayList<ArrayList<Integer>> s = new ArrayList<>();
	public static ArrayList<ArrayList<Integer>> d = new ArrayList<>();
	public static ArrayList<ArrayList<Integer>> t = new ArrayList<>();
	
	public static ArrayList<Integer> BFS(ArrayList<ArrayList<Integer>> g,boolean visited[],int i)
	{
		visited[i] = true;
		Queue<Integer> q = new LinkedList<>();
		ArrayList<Integer> list = new ArrayList<>();
		list.add(i);
		q.add(i);
		while(q.size()!=0)
		{
			i = q.poll();
			Iterator<Integer> it = g.get(i).listIterator();
			while(it.hasNext())
			{
				int x = it.next();
				if(!visited[x])
				{
					visited[x] = true;
					q.add(x);
					list.add(x);
				}
			}
		}
		return list;
	}
	
	public void run()	
	{
		InputReader in = new InputReader(System.in);
		PrintWriter w = new PrintWriter(System.out);
		int n = in.nextInt();
		int m = in.nextInt();
		ArrayList<ArrayList<Integer>> g = new ArrayList<>();
		ArrayList<ArrayList<Integer>> res = new ArrayList<>();
		int i,j,k;
		for(i=0;i<=n;i++)
		{
			g.add(new ArrayList<>());
			//res.add(new ArrayList<>());
		}
		for(i=0;i<m;i++)
		{
			int x = in.nextInt();
			int y = in.nextInt();
			g.get(x).add(y);
			g.get(y).add(x);
		}
		boolean visited[] = new boolean[n+1];
		for(i=1;i<=n;i++)
		{
			if(!visited[i])
			{
				res.add(BFS(g,visited,i));
			}
		}
		//w.println(res);
		boolean flag = true;
		Iterator<ArrayList<Integer>> it = res.listIterator();
		while(it.hasNext())
		{
			ArrayList<Integer> temp = it.next();
			if(temp.size()==1)
			{
				s.add(temp);
				//it.remove(temp);
			}
			if(temp.size()==2)
			{
				d.add(temp);
				//res.remove(d.get(d.size()-1));
			}
			if(temp.size()==3)
			{
				t.add(temp);
				//res.remove(temp);
			}
			if(temp.size()>3)
			{
				flag = false;
			}
		}
		if(Math.abs(d.size()-s.size())%3!=0 || (d.size()>0 && s.size()==0) || (d.size()>s.size()))
		{
		   // w.println("HI");
		    flag = false;
		}
		if(flag)
		{
			Iterator<ArrayList<Integer>> itt = t.listIterator();
			while(itt.hasNext())
			{
				ArrayList<Integer> temp = itt.next();
				w.println(temp.get(0) + " " + temp.get(1) +  " " + temp.get(2));
			//	w.println(temp);
			}
			
			Iterator<ArrayList<Integer>> itd = d.listIterator();
			while(itd.hasNext())
			{
				ArrayList<Integer> temp = itd.next();
				w.println(temp.get(0) + " " + temp.get(1) + " " + s.get(0).get(0));
				s.remove(0);
			}
			while(s.size()>=3)
			{
				w.println(s.get(0).get(0) + " " + s.get(1).get(0) + " " +s.get(2).get(0));
				s.remove(0);
				s.remove(0);
				s.remove(0);
			}
			//w.println("HI");
		}
		else
		{
			w.println(-1);
		}
	//	w.println(res);
		/*w.println(s);
		w.println(d);
		w.println(t);*/
		w.flush();
		w.close();
	}
}