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.awt.Point;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.Map.Entry;

import static java.lang.Math.*;

public class Solve implements Runnable{
    
final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");
    
    void init() throws FileNotFoundException{
        if (ONLINE_JUDGE){
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }else{
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }
    
    String readString() throws IOException{
        while(!tok.hasMoreTokens()){
            try{
                tok = new StringTokenizer(in.readLine());
            }catch (Exception e){
                return null;
            }
        }
        return tok.nextToken();
    }
    
    int readInt() throws IOException{
        return Integer.parseInt(readString());
    }
    
    long readLong() throws IOException{
        return Long.parseLong(readString());
    }
    
    double readDouble() throws IOException{
        return Double.parseDouble(readString());
    }
    
    public static void main(String[] args){
        new Thread(null, new Solve(), "", 256 * (1L << 20)).start();
    }
    
    long timeBegin, timeEnd;

    void time(){
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }
    
    void debug(Object... objects){
        if (!ONLINE_JUDGE){
            for (Object o: objects){
                System.err.println(o.toString());
            }
        }
    }
    
    int sm(int x){
        if (x==1) return 0;else return 1;
    }
    
    int gcd(int a,int b){
        if (b==0) return a;
        else{
            return gcd(b,a%b);
        }
    }
    
    
    
    
   
    ArrayList<Integer> graph[];
    boolean vis[];
    
    
    void dfs(int x){
        vis[x]=true;
        for (int y:graph[x]){
            if (!vis[y]){
                dfs(y);
            }
        }
    }
    
    
    
    void solve() throws IOException{ 
        int n=readInt();
        
        ArrayList<Integer> ans=new ArrayList<Integer>();
        int m=readInt();
        graph=new ArrayList[n+1];
        vis=new boolean[n+1];
        ArrayList<Integer> list[]=new ArrayList[n+1];
        for (int i=1;i<n+1;i++){
            graph[i]=new ArrayList<Integer>();
            list[i]=new ArrayList<Integer>();
        }
        for (int i=0;i<m;i++){
            int a=readInt();
            int b=readInt();
            graph[a].add(b);
            graph[b].add(a);    
        }
        int k=0;
        for (int i=1;i<=n;i++){
            if (!vis[i]){
                dfs(i);
                k++;
            }
        }
        //if (k*3!=n){
        //  out.println(-1);
        //  return;
        //}
        for (int i=1;i<=n;i++){
            vis[i]=false;           
        }
        
        
        
        for (int i=1;i<=n;i++){
            if (!vis[i]){
                dfs(i);
                int kolvo=0;
                for (int j=1;j<=n;j++){                 
                    if (vis[j] && !ans.contains(j)){
                        ans.add(j);
                        kolvo++;  
                        list[i].add(j);
                    }
                    
                }               
            }       
        }
        int ind=0;
        int k2=0,k3=0;
        
        for (int i=1;i<n+1;i++){
            if (list[i].size()==2) k2++;
            if (list[i].size()==3) k3++;
            if (list[i].size()>3){
                out.println(-1);
                return;
            }           
        }
        if (k2>0 &&  k2>(n-k3*3-k2*2)){
            out.println(-1);
            return;
        }
        int k1=(n-k3*3-k2*2);
        if (k1+k2*2+k3*3!=n){
            out.println("-1");
            return;
        }
        
        
        
        boolean viss[]=new boolean[n+1];
        
        for (int i=1;i<=n;i++){
            if (list[i].size()==2 || list[i].size()==3){
                for (int z:list[i]){
                    viss[z]=true;
                }
            }
        }
        int kl=0;
        for (int i=1;i<=n;i++){
            if (!viss[i]) kl++;
        }
        int[] ar=new int[kl];
        int l=0;
        for (int i=1;i<=n;i++){
            if (!viss[i]) {
                ar[l]=i;
                l++;
            }
        }
        l=0;
        for (int i=1;i<=n;i++){
            if (list[i].size()==3){
                for (int z:list[i]){
                    out.print(z+" ");
                }
                out.println();
            }else{
                if (list[i].size()==2){
                    for (int z:list[i]){
                        out.print(z+" ");
                    }
                    out.println(ar[l]);
                    l++;
                }               
            }
        }
        
        int p=0;
        for (int i=l;i<kl;i++){
            p++;
            if (p==4){
                out.println();
                p=1;
            }
            out.print(ar[i]+" ");           
        }
        
        
        
        
        
        
       
       
       
        
        


        
    }
        
        
        
    
    
    public void run(){
        try{
            timeBegin = System.currentTimeMillis();
            init();
            solve();
            out.close();
            time();
        }catch (Exception e){
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }
    
    
}