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

public class Coach {
    static boolean[] v = new boolean[100];
    static ArrayList<ArrayList<Integer>> adj = new ArrayList<ArrayList<Integer>>(100);
    public static ArrayList<Integer> dfs(ArrayList<ArrayList<Integer>> adj,int j,ArrayList<Integer>list)
    {
       list.add(j);//it contains the list of all the nodes that comes under one connected component
        v[j]=true;
        for(int i=0;i<adj.get(j).size();i++)
        {
            int child=adj.get(j).get(i);
            if(v[child]==false)
                dfs(adj,child,list);
        }


        return list;

    }
    public static void main(String[]args)throws IOException
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

        StringTokenizer tk=new StringTokenizer(br.readLine());
        int N = Integer.parseInt(tk.nextToken());
        int M = Integer.parseInt(tk.nextToken());
        int i,j;

        for (i = 0; i < N; i++)
            adj.add(new ArrayList<Integer>());

        while ((M--) != 0) {
            StringTokenizer tk1=new StringTokenizer(br.readLine());
            int a = Integer.parseInt(tk1.nextToken());
            int b = Integer.parseInt(tk1.nextToken());
            adj.get(a - 1).add(b - 1);
            adj.get(b - 1).add(a - 1);
        }
        ArrayList<ArrayList<Integer>> components=new ArrayList<ArrayList<Integer>>();//it contains all the connected components
        for(i=0;i<N;i++)
        {
            if(v[i]==false)
            {
                ArrayList<Integer>list=new ArrayList<Integer>();
                list=dfs(adj,i,list);
                components.add(list);


            }
        }
        int countOne=0,countTwo=0;
        for(i=0;i<components.size();i++)
        {
            if(components.get(i).size()==1 || components.get(i).size()==2 || components.get(i).size()==3)//if there is one or two or three vertex connected components then count only one-vertex and two -vertext components
            {
                if(components.get(i).size()==1)
                    countOne++;
                else if(components.get(i).size()==2)
                    countTwo++;
            }
            //but if there are more than three vertext connected components then -1 because a team can have only 3 members
            else {
                System.out.println("-1");
                break;
            }
        }

        boolean check[]=new boolean[components.size()];//to keep a check that which one vertex connected components are connected with two vertex
        if(i==components.size())//this line comes true if in the previous for loop there is no break
        {
            if(countOne>=countTwo && (countOne-countTwo)%3==0)//we can make a team of three with one or two vertext components if and only if the count of one vertex is greater than two vertex and the remaining one vertex after pairing with two vertex is mod of 3
            {
               for(i=0;i<components.size();i++)
               {
                   if(components.get(i).size()==3)
                   {
                       for(j=0;j<components.get(i).size();j++)
                       {
                           System.out.print((components.get(i).get(j)+1)+" ");
                       }
                       System.out.println();
                   }
                   if(components.get(i).size()==2)//if it holds then we need to find out one vertex comp to pair with it and also check whether that one vertex is already not paired with others
                   {
                       for(j=0;j<components.size();j++)
                       {
                           if(components.get(j).size()==1 && !check[j])
                           {
                               check[j]=true;
                               break;
                           }
                       }
                       System.out.print((components.get(i).get(0)+1)+" ");
                       System.out.print((components.get(i).get(1)+1)+" ");
                       System.out.print((components.get(j).get(0)+1)+" ");
                       System.out.println();
                   }
               }
               //below code is for the remaining one vertex comp that needs to form a team of 3
               int c=0;
               for(i=0;i<components.size();i++)
               {
                   if(components.get(i).size()==1 && !check[i])
                   {
                       //if three one vertex comp forms a team then the counter will be set back to 0
                       if(c==3)
                       {
                           System.out.println();// for in each lines we need to print 3 nodes which are in one team
                           c=0;
                       }
                       System.out.print((components.get(i).get(0)+1)+" ");
                       c++;
                   }
               }
            }
            else
                System.out.println("-1");
        }


    }
}
