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

public class a implements Runnable{
    static int [] parent;
    static int [] size;
    static List<Integer> [] al;

    static int find(int k){
        if(parent[k]!=k)
           parent[k]=find(parent[k]);
        return parent[k];
    }

    static void merge(int a,int b){
        int u=find(a);
        int v=find(b);
        if(v==u)return;
        parent[u]=v;
        size[v]+=size[u];
    }
    static void print(int u,int p){
        System.out.print(u+" ");
        for(int v : al[u]){
            if(v!=p)print(v,u);
        }
    }
    public static void main(String [] args) throws IOException{
      Thread t=new Thread(null,new a(),"name",1<<25);
      t.start();
    }


    @Override
    public void run(){
        FastScanner sc=new FastScanner();
        int n=0,m=0;
        try{
            n=sc.nextInt();
            m=sc.nextInt();
            parent=new int[n+1];
            size=new int[n+1];
            al=new ArrayList[n+1];

            for(int i=1;i<=n;i++){
                parent[i]=i;
                size[i]=1;
                al[i]=new ArrayList<>();
            }

            for(int i=0;i<m;i++){
                int a=sc.nextInt();
                int b=sc.nextInt();
                merge(a,b);
            }

            boolean ok=true;
            Queue<Integer> one=new LinkedList<>();
            Queue<Integer> two=new LinkedList<>();

            for(int i=1;i<=n && ok;i++){
                int sz=size[find(i)];
                if(sz>3)ok=false;
                else{
                    if(sz==1)one.add(i);
                    else if(sz==2){
                        if(i==find(i))two.add(i);
                    }
                }
            }

            if(!ok){
                System.out.println(-1);
                return;
            }
            
            while(( !two.isEmpty()  || !one.isEmpty())){
                if(two.size()>one.size()){
                    System.out.println(-1);
                    return;
                }
                else{
                    if(two.size()!=0){
                        int u=two.poll();
                        int v=one.poll();
                        merge(u,v);
                    }
                    else{
                        if(one.size()%3!=0){
                            System.out.println(-1);
                            return;
                        }
                        else{
                            int a=one.poll();
                            int b=one.poll();
                            int c=one.poll();
                            merge(a,b);
                            merge(a,c); 
                        }
                    }
                }
            }
            
            
            Set<Integer> pr=new HashSet<>();
            for(int i=1;i<=n;i++){
                int p=find(i);
                pr.add(p);
                al[p].add(i);
            }


            for(int x : pr){
                for(int v : al[x]){
                    System.out.print(v+" ");
                }
                System.out.println("");
            }

        }
        catch(IOException e){}


    }

   

}







// 612-3706163

// sbi.03129@sbi.co.in



/**
5 6
1 2
2 3
1 4
4 3
1 5
5 3 

 */

























class FastScanner{	
    private int BUFFER_SIZE = 1 << 16;
   
   private  DataInputStream din;
   
   private  byte[] buffer;
   
   private int bufferPointer, bytesRead;
   
   public FastScanner() {
       din = new DataInputStream(System.in);
       buffer = new byte[BUFFER_SIZE];
       bufferPointer = bytesRead = 0;
   }

   public FastScanner( 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];
       int cnt = 0, c;
       while ((c = read()) != -1) {
           if (c == '\n')
               break;
           buf[cnt++] = (byte) c;
       }
       return new String(buf, 0, cnt);
   }
   
   public String next() throws IOException{

       byte c = read();
       while(Character.isWhitespace(c)){
           c = read();
       }
       
       StringBuilder builder = new StringBuilder();
       builder.append((char)c);
       c = read();
       while(!Character.isWhitespace(c)){
           builder.append((char)c);
           c = read();
       }
       
       return builder.toString();
   }

   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 int[] nextIntArray( int n) throws IOException {
        int arr[] = new int[n];
       for(int i = 0; i < n; i++){
           arr[i] = nextInt();
       }
       return arr;
   }

   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 long[] nextLongArray( int n) throws IOException {
        long arr[] = new long[n];
       for(int i = 0; i < n; i++){
           arr[i] = nextLong();
       }
       return arr;
   }

   public char nextChar() throws IOException{
       byte c = read();
       while(Character.isWhitespace(c)){
           c = read();
       }
       return (char) c;	
   }
   
   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;
   }
   
   public double[] nextDoubleArray( int n) throws IOException {
        double arr[] = new double[n];
       for(int i = 0; i < n; i++){
           arr[i] = nextDouble();
       }
       return arr;
   }

   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();
   }

}