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 Cf131 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 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 Cf131(),"Main",1<<27).start();
    }
    
    static class Pair{
		int nod;
        int ucn;
        int siz;
		
		Pair(int nod,int ucn,int siz){
			this.nod=nod;
            this.ucn=ucn;
            this.siz = siz;
		}
		
	public static Comparator<Pair> wc = new Comparator<Pair>(){
		public int compare(Pair e1,Pair e2){
            int c1 = e1.ucn - e1.siz;
            int c2 = e2.ucn - e2.siz;
            //reverse order
			if (c1 < c2) 
                return 1;  // 1 for swaping.
            else if (c1 > c2) 
                return -1; 
            else{
                if(e1.siz>e2.siz)
                    return 1;
                else
                    return -1;
            } 
		}
	};	
	}

    public static int gcd(int a,int b){
        if(b==0)return a;
        else return gcd(b,a%b);
    }
//// iterative BFS
    public static void bfs(int s,ArrayList<Integer>[] a,/*int[] dist,*/boolean[] b,ArrayList<Integer> x,PrintWriter w){
        b[s]=true;
        
        Queue<Integer> q = new LinkedList<>();
        q.add(s);
        while(q.size()!=0){
            int i=q.poll();
        //    w.println(" #"+i+"# ");
            Iterator<Integer> it =a[i].listIterator();
            int z=0;
            while(it.hasNext()){
                z=it.next();
                
                if(!b[z]){
                //    w.println("* "+z+" *");
                    b[z]=true;
                //  dist[z] = dist[i]+1;
                    x.add(z);
                //    w.println("@ "+x.get(x.size()-1)+" @");
                    q.add(z);
                }
            }   
        
        }
    }
////recursive BFS
    public static int bfsr(int s,ArrayList<Integer>[] a,int[] dist,boolean[] b,int[] pre){
        b[s]=true;
        int p = 0;
        int t = a[s].size();
        for(int i=0;i<t;i++){
            int x = a[s].get(i);
            if(!b[x]){
                dist[x] = dist[s] + 1;
                p+= (bfsr(x,a,dist,b,pre)+1);
            }
        }
        pre[s] = p;
        return p;
    }



  


//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
  
 
    public void run()
    {
        InputReader sc = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);
        
        //int t= sc.nextInt();
        //while(t-->0){
            int n = sc.nextInt();
            int m = sc.nextInt();
            ArrayList<Integer> a[] = new ArrayList[n+1];
            for(int i=1;i<=n;i++)a[i] = new ArrayList<Integer>();
            for(int i=0;i<m;i++){
                int x = sc.nextInt();
                int y = sc.nextInt();
                a[x].add(y);
                a[y].add(x);
            }
            boolean[] b = new boolean[n+1];
            Queue<Integer> free = new LinkedList<Integer>();
            ArrayList< ArrayList<Integer> > g = new ArrayList< ArrayList<Integer> >();
            boolean f = true;
            for(int i=1;i<=n;i++){
                
                if(a[i].size()>0){
                    if(!b[i]){
                        // b[i]=true;
                    //    w.println(i+" enter");
                        ArrayList<Integer> x = new ArrayList<Integer>();
                        x.add(i);
                        bfs(i,a,b,x,w);
                        if(x.size()>3){f=false;break;}
                        else if(x.size()>1)g.add(x);
                        else free.add(i);
                        

                    }
                }
                else free.add(i);

            }
   //    w.println("f= "+f+" g= "+g.size()+" free= "+free.size());
            if(f){
               boolean yy = true;
                for(int i=0;i<g.size();i++){
                    int z = g.get(i).size();
                    if(z==2){
                        if(free.size()<=0){
                            w.print(-1);
                            yy = false;
                            break;
                        }
                        else{
                            g.get(i).add(free.poll());
                        }
                    }
                    // if(z==3){
                    
                    // }
                    // else{
                    //     ArrayList<Integer> y = g.get(i);
                    //    // if(q.size()>0)
                    //     w.println(y.get(0)+" "+y.get(1)+" "+free.poll());
                    // }
                }
                if(yy){
                    if(free.size()%3!=0)w.print(-1);
                    else{
                     //   w.println("fd");
                        for(int i=0;i<g.size();i++){
                            ArrayList<Integer> y = g.get(i);
                            for(int j=0;j<y.size();j++)
                            w.print(y.get(j)+" ");
                            w.println();
                        }
                        while(free.size()>0){
                            w.println(free.poll()+" "+free.poll()+" "+free.poll());
                        }
                    }
                }
            }
            else w.print("-1");
            
            

       // }
        w.flush();
        w.close();

        
    }

}