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 
import java.util.*;


import java.io.*;
import java.math.*;

public class Practice

{ 
	 static FastReader sc=new FastReader(); 
	 static int mod=(int)Math.pow(10, 9)+7;
	 static int dp[][];
	 static int dx[]= {-1,0,1,0};
	 static int dy[]= {0,1,0,-1};
	 //static ArrayList<Integer> l=new ArrayList<Integer>();
	 
		  public static void main(String[] args) 
    {
			   PrintWriter out=new PrintWriter(System.out);
			  //StringBuffer sb=new StringBuffer("");
			  
			  int ttt=1;
			    //ttt =i(); 
		        outer :while (ttt-- > 0) 
				{
		        	int n=i()+1;
		        	int m=i();
		        	ArrayList<Integer> A[]=new ArrayList[n];
		        	for(int i=0;i<A.length;i++) {
		        		A[i]=new ArrayList<Integer>();
		        	}
		        	for(int i=0;i<m;i++) {
		        		int a=i();
		        		int b=i();
		        		A[a].add(b);
		        		A[b].add(a);
		        	}
		        	if(m==0) {
		        		for(int i=1;i<n;i+=3) {
		        			System.out.println(i+" "+(i+1)+" "+(i+2));
		        		}
		        		return;
		        	}

		        	boolean v[]=new boolean[n];
		        	ArrayList<ArrayList<Integer>> l=new ArrayList<ArrayList<Integer>>();
		        	for(int i=1;i<n;i++) {
		        		if(!v[i]) {
		        			ArrayList<Integer> ans=dfs(A, i, v);
		        			if(ans.size()>3) {
		        				System.out.println("-1");
		        				return;
		        			}
		        			l.add(ans);
		        		}
		        	}
		        	int o=0,t=0;
		        	int sum=0;
		        	for(int i=0;i<l.size();i++) {
		        		int tt=l.get(i).size();
		        		if(tt%3==1)
		        			o++;
		        		if(tt%3==2)
		        			t++;
		        		
		        	}
		        	if(t>o) {
		        		System.out.println("-1");
		        		return;
		        	}
		        	o-=t;
		        	if(o%3!=0) {
		        		System.out.println("-1");
		        		return;
		        	}
		        	
		        	
		        	Arrays.fill(v, false);
		        	for(int i=0;i<l.size();i++) {
		        		if(v[i])
		        			continue;
		        		if(l.get(i).size()==3) {
		        			System.out.println(l.get(i).get(0)+" "+l.get(i).get(1)+" "+l.get(i).get(2));
		        			v[i]=true;
		        		}
		        		if(l.get(i).size()==1) {
		        			v[i]=true;
		        			System.out.print(l.get(i).get(0)+" ");
		        			int f=0;
		        			for(int j=0;j<l.size();j++) {
		        				if(v[j])
		        					continue;
		        				if(l.get(j).size()==2) {
		        					System.out.print(l.get(j).get(0)+" "+l.get(j).get(1));
		        					System.out.println();
		        					v[j]=true;
		        					f=1;
		        					break;
		        				}
		        			}
		        			if(f==0) {
		        				for(int j=0;j<l.size();j++) {
			        				if(v[j])
			        					continue;
			        				if(l.get(j).size()==1) {
			        					System.out.print(l.get(j).get(0)+" ");
			        					v[j]=true;
			        					f++;
			        					if(f==2) {
			        						System.out.println();
			        					break;
			        					}
			        				}
			        			}
		        			}
		        		}
		        	}
		        	
//		        	int i=0;
//		        	int j=0;
//		        	int c=0;
//		        	while(i<l.size()) {
//		        		ArrayList<Integer> a=l.get(i);
//		        		
//		        		if(c==3) {
//		        			c=0;
//		        			System.out.println();
//		        			continue;
//		        		}
//		        		if(j<a.size()) {
//		        			System.out.print(a.get(j)+" ");
//		        			c++;
//		        			j++;
//		        		}
//		        		else {
//		        			i++;
//		        			j=0;
//		        		}
//		        	}
//		        	
				}
			     out.close();
		    	//System.out.println(sb.toString());
		        	
    }
		  
		 

		  private static ArrayList<Integer> dfs(ArrayList<Integer> [] A, int i, boolean[] v) {
				v[i]=true;
				ArrayList<Integer> ans=new ArrayList<Integer>();
				ans.add(i);
				for(int child : A[i]) {
					if(!v[child]) {
						ArrayList<Integer> l=dfs(A, child, v);
						ans.addAll(l);
					}
				}
				return ans;
				
			}






static int[] input(int n) {
	int A[]=new int[n];
	   for(int i=0;i<n;i++) {
		   A[i]=sc.nextInt();
	   }
	   return A;
   }
static long[] inputL(int n) {
	long A[]=new long[n];
	   for(int i=0;i<n;i++) {
		   A[i]=sc.nextLong();
	   }
	   return A;
   }
static String[] inputS(int n) {
	String A[]=new String[n];
	   for(int i=0;i<n;i++) {
		   A[i]=sc.next();
	   }
	   return A;
   }
static long sum(int A[]) {
	long sum=0;
	for(int i : A) {
		sum+=i;
	}
	return sum;
}

static void input(int A[],int B[]) {
	   for(int i=0;i<A.length;i++) {
		   A[i]=sc.nextInt();
		   B[i]=sc.nextInt();
	   }
}
static int[][] input(int n,int m){
	int A[][]=new int[n][m];
	for(int i=0;i<n;i++) {
		for(int j=0;j<m;j++) {
			A[i][j]=i();
		}
	}
	return A;
}
static int max(int A[]) {
	int max=Integer.MIN_VALUE;
	for(int i=0;i<A.length;i++) {
		max=Math.max(max, A[i]);
	}
	return max;
}
static int min(int A[]) {
	int min=Integer.MAX_VALUE;
	for(int i=0;i<A.length;i++) {
		min=Math.min(min, A[i]);
	}
	return min;
}
static long max(long A[]) {
	long max=Long.MIN_VALUE;
	for(int i=0;i<A.length;i++) {
		max=Math.max(max, A[i]);
	}
	return max;
}
static long min(long A[]) {
	long min=Long.MAX_VALUE;
	for(int i=0;i<A.length;i++) {
		min=Math.min(min, A[i]);
	}
	return min;
}
static long mod(long x) {
	 int mod=1000000007;
	  return ((x%mod + mod)%mod);
}

     static int i() {
    	 return sc.nextInt();
     }
     static String s() {
    	 return sc.next();
     }
     static long l() {
    	 return sc.nextLong();
     }  
     static void sort(int[] A){
        int n = A.length;
        Random rnd = new Random();
        for(int i=0; i<n; ++i){
            int tmp = A[i];
            int randomPos = i + rnd.nextInt(n-i);
            A[i] = A[randomPos];
            A[randomPos] = tmp;
        }
        Arrays.sort(A);
     }
     static void sort(long[] A){
	        int n = A.length;
	        Random rnd = new Random();
	        for(int i=0; i<n; ++i){
	            long tmp = A[i];
	            int randomPos = i + rnd.nextInt(n-i);
	            A[i] = A[randomPos];
	            A[randomPos] = tmp;
	        }
	        Arrays.sort(A);
	     }
     static HashMap<Integer,Integer> hash(int A[]){
   	  HashMap<Integer,Integer> map=new HashMap<Integer, Integer>();
   	  for(int i : A) {
   		  if(map.containsKey(i)) {
   			  map.put(i, map.get(i)+1);
   		  }
   		  else {
   			  map.put(i, 1);
   		  }
   	  }
   	  return map;
     }
  static String sort(String s) {
 	 Character ch[]=new Character[s.length()];
 	 for(int i=0;i<s.length();i++) {
 		 ch[i]=s.charAt(i);
 	 }
 	 Arrays.sort(ch);
 	 StringBuffer st=new StringBuffer("");
 	 for(int i=0;i<s.length();i++) {
 		 st.append(ch[i]);
 	 }
 	 return st.toString();
  }
     static boolean prime(int n) 
	    { 
	        if (n <= 1) 
	            return false; 
	        if (n <= 3) 
	            return true; 
	        if (n % 2 == 0 || n % 3 == 0) 
	            return false; 
	        double sq=Math.sqrt(n);
	  
	        for (int i = 5; i <= sq; i = i + 6) 
	            if (n % i == 0 || n % (i + 2) == 0) 
	                return false; 
	        return true; 
	    } 
     static boolean prime(long n) 
	    { 
	        if (n <= 1) 
	            return false; 
	        if (n <= 3) 
	            return true; 
	        if (n % 2 == 0 || n % 3 == 0) 
	            return false; 
	        double sq=Math.sqrt(n);
	  
	        for (int i = 5; i <= sq; i = i + 6) 
	            if (n % i == 0 || n % (i + 2) == 0) 
	                return false; 
	        return true; 
	    } 
     static int gcd(int a, int b) 
     { 
         if (a == 0) 
             return b; 
         return gcd(b % a, a); 
     } 
     static long gcd(long a, long b) 
     { 
         if (a == 0) 
             return b; 
         return gcd(b % a, a); 
     } 
     static class Pair implements Comparable<Pair>
     {
    	 int x;
    	 int y;
    	 Pair(int x,int y){
    		 this.x=x;
    		 this.y=y;
    	 }
		@Override
		public int compareTo(Pair o) {
			if(this.x>o.x)
				return -1;
			else if(this.x<o.x)
				return 1;
			else
				return this.y-o.y;
		}
     }
        
    static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
} 



