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.BigInteger;
public class GFG {
    static class edge{
        int s,d,w;
        public edge(int s,int d,int w)
        {
            this.s=s;
            this.d=d;
            this.w=w;
        }
    }
    
    static class graph{
        int v;
        LinkedList<edge> li[];
        boolean visit[];
        boolean visit1[];
        int p,l;
        int v1[];
        public graph(int v)
        {
            this.v=v;
            p=0;
            l=0;
            v1=new int[v];
            visit=new boolean[v];
             visit1=new boolean[v];
           
            li=new LinkedList[v];
            for(int i=0;i<v;i++)
            li[i]=new  LinkedList<>();
        }
        public void addedge(int x,int y,int w)
        {
            edge e=new edge(x,y,w);
            li[x].add(e);
            edge e1=new edge(y,x,w);
            li[y].add(e1);
        }
            
        public int bfs(int s,ArrayList<Integer> a)
        {
            LinkedList<Integer> q=new LinkedList<Integer>();
            q.add(s);
            HashSet<Integer> h=new HashSet<Integer>();
            int c=0;
            visit[s]=true;
            h.add(s);
            c++;
            while(q.size()!=0){
                s=q.poll();
                Iterator<edge> i=li[s].listIterator();
                while(i.hasNext()){int n=i.next().d;
                if(!visit[n]){visit[n]=true;c++;h.add(n);q.add(n);
                }
            }
        }
        if(c==2){
            for(int i=0;i<v;i++)
        {if(visit[i]&&h.contains(i))
        System.out.print((i+1)+" ");}
        System.out.println(a.get(p)+1);p++;
        return 1;
        }
        if(c==3){
        for(int i=0;i<v;i++)
        {if(visit[i]&&h.contains(i))
        System.out.print((i+1)+" ");}
        System.out.println();
            return 1;
        }
        return 0;
    }
        public int bfs1(int s)
        {
            LinkedList<Integer> q=new LinkedList<Integer>();
            q.add(s);
            HashSet<Integer> h=new HashSet<Integer>();
            int c=0;
            visit1[s]=true;
            h.add(s);
            c++;
            while(q.size()!=0){
                s=q.poll();
                Iterator<edge> i=li[s].listIterator();
                while(i.hasNext()){int n=i.next().d;
                if(!visit1[n]){visit1[n]=true;c++;h.add(n);q.add(n);
                }
            }
        }
        return c;
        }

    }
        public static void main (String[] args)throws IOException {
		Reader sc=new Reader();
		
        int n=sc.nextInt();
        int m=sc.nextInt();
        graph g=new graph(n);
        if(m==0)
        {
            for(int i=n;i>=1;i--)
            System.out.print(i+" ");
            System.out.println();
        }
        HashSet<Integer> h=new HashSet<Integer>();
        if(m!=0){
        for(int j=0;j<m;j++)
        {   int x=sc.nextInt();
            int y=sc.nextInt();
            if(!h.contains(x-1)){h.add(x-1);}
              if(!h.contains(y-1)){h.add(y-1);}
          g.addedge(x-1,y-1,0);
        }
          ArrayList<Integer> a=new ArrayList<Integer>();
        for(int i=0;i<n;i++)
        {
            if(!h.contains(i))
            a.add(i);
        }
        int k=0,f=0,g1=0;
        for(int i=0;i<n;i++){
        k=g.bfs1(i);
        if(k==3)
        f++;
        if(k==2)
        g1++;
        }
        f=f+(int)Math.min(g1,a.size());
        f=f+((a.size()-g1)>0?(a.size()-g1)/3:0);
        //System.out.println(f);
        if(n==h.size()){
        if(f!=(n/3)){
        System.out.println(-1);}
        if(f==(n/3))
        {   for(int i=0;i<n;i++)
            g.bfs(i,a);
        }
        }
        if(n!=h.size()){
            if(f!=(n/3)){
        System.out.println(-1);}
        if(f==(n/3)){
            int l=0;
        for(int i=0;i<n;i++)
        l=l+g.bfs(i,a);
        if(l!=(n/3)){
            int p=a.size()-1;
            while(true)
            {
                if(l==(n/3))
                break;
                for(int i=p;i>p-3;i--)
                System.out.print((a.get(i)+1)+" ");
                System.out.println();
                l++;
                p=p-3;
            }
        }
        //f=f+n-h.size();
        //for(int i=0;i<n;i++)
        //g.bfs(i,a);
        }
        }
    }
        }
         static class Reader 
    { 
        final private int BUFFER_SIZE = 1 << 16; 
        private DataInputStream din; 
        private byte[] buffer; 
        private int bufferPointer, bytesRead; 
  
        public Reader() 
        { 
            din = new DataInputStream(System.in); 
            buffer = new byte[BUFFER_SIZE]; 
            bufferPointer = bytesRead = 0; 
        } 
  
        public Reader(String file_name) throws IOException 
        { 
            din = new DataInputStream(new FileInputStream(file_name)); 
            buffer = new byte[BUFFER_SIZE]; 
            bufferPointer = bytesRead = 0; 
        } 
  
        public String readLine() throws IOException 
        { 
            byte[] buf = new byte[64]; // line length 
            int cnt = 0, c; 
            while ((c = read()) != -1) 
            { 
                if (c == '\n') 
                    break; 
                buf[cnt++] = (byte) c; 
            } 
            return new String(buf, 0, cnt); 
        } 
  
        public int nextInt() throws IOException 
        { 
            int ret = 0; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
            do
            { 
                ret = ret * 10 + c - '0'; 
            }  while ((c = read()) >= '0' && c <= '9'); 
  
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        public long nextLong() throws IOException 
        { 
            long ret = 0; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
            do { 
                ret = ret * 10 + c - '0'; 
            } 
            while ((c = read()) >= '0' && c <= '9'); 
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        public double nextDouble() throws IOException 
        { 
            double ret = 0, div = 1; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
  
            do { 
                ret = ret * 10 + c - '0'; 
            } 
            while ((c = read()) >= '0' && c <= '9'); 
  
            if (c == '.') 
            { 
                while ((c = read()) >= '0' && c <= '9') 
                { 
                    ret += (c - '0') / (div *= 10); 
                } 
            } 
  
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        private void fillBuffer() throws IOException 
        { 
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); 
            if (bytesRead == -1) 
                buffer[0] = -1; 
        } 
  
        private byte read() throws IOException 
        { 
            if (bufferPointer == bytesRead) 
                fillBuffer(); 
            return buffer[bufferPointer++]; 
        } 
  
        public void close() throws IOException 
        { 
            if (din == null) 
                return; 
            din.close(); 
        } 
    } 
  
}