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.*;

public class Coach300B
{
    public static class Graph
    {
        private boolean[][] edges;
        private int vertices;

        public Graph(int inputvertices)
        {
            vertices = inputvertices;
            edges = new boolean[vertices][vertices];
        }

        public void addEdge(int start, int finish)
        {
            edges[start][finish] = true;
        }

        public boolean isEdge(int start, int finish)
        {
            return edges[start][finish];
        }

        public ArrayList<Integer> neighbors(int vertex)
        {
            ArrayList<Integer> returnme = new ArrayList<Integer>();
            for (int col = 0; col < vertices; col++)
            {
                if (edges[vertex][col] == true)
                {
                    returnme.add(col);
                }
            }
            return returnme;
        }

        public int size()
        {
            return vertices;
        }

        public void depthFirstPrint(int startvertex)
        {
            boolean[] marked = new boolean[vertices];
            depthFirstRecurse(startvertex, marked);
        }

        private void depthFirstRecurse(int vertex, boolean[] marked)
        {
            marked[vertex] = true;
            ArrayList<Integer> connections = neighbors(vertex);
            for (Integer i: connections)
            {
                if (!marked[i])
                {
                    depthFirstRecurse(i, marked);
                }
            }
        }
        
        public ArrayList<Integer> dfs(int vertex, boolean[] marked, ArrayList<Integer> connected)
        {
            marked[vertex] = true;
            connected.add(vertex);
            ArrayList<Integer> nbrs = neighbors(vertex);
            for (Integer x: nbrs)
            {
                if (!marked[x])
                {
                    dfs(x, marked, connected);
                }
            }
            return connected;
        }

        public void breadthFirstPrint(int startvertex)
        {
            boolean[] marked = new boolean[vertices];
            Queue<Integer> q = new LinkedList<Integer>();
            marked[startvertex] = true;
            q.add(startvertex);
            while (!q.isEmpty())
            {
                int vertex = q.remove();
                ArrayList<Integer> connections = neighbors(vertex);
                for (Integer i: connections)
                {
                    if (!marked[i])
                    {
                        marked[i] = true;
                        q.add(i);
                    }
                }
            }
        }
    }
    
    public static void main(String[] args) 
    {
        // Set up scanner
        Scanner sc = new Scanner(System.in); 
        // System.out.println("Enter n");
        int n = sc.nextInt();
        // System.out.println("Enter m");
        int m = sc.nextInt();
        Graph g = new Graph(n);
        
        for (int i=0; i<m; i++)
        {
            // System.out.println("Enter a");
            int a = sc.nextInt();
            // System.out.println("Enter b");
            int b = sc.nextInt();
            g.addEdge(a-1,b-1);
        }
        
        boolean[] marked = new boolean[n];  // Mark when we process it
        ArrayList<Integer> singles = new ArrayList<Integer>();
        ArrayList<ArrayList<Integer>> doubles = new ArrayList<ArrayList<Integer>>();
        ArrayList<ArrayList<Integer>> triples = new ArrayList<ArrayList<Integer>>();
        for (int i=0; i<n; i++)
        {
            if (!marked[i])
            {
                ArrayList<Integer> connected = new ArrayList<Integer>();
                connected = g.dfs(i, marked, connected);
                if (connected.size() > 3)
                {
                    System.out.println(-1);
                    return;
                }
                else if (connected.size() == 3)
                {
                    triples.add(connected);
                }
                else if (connected.size() == 2)
                {
                    doubles.add(connected);
                }
                else // if (connected.size() == 1)
                {
                    singles.add(i);
                }
            }
        }
        
        // See if there are enough singles to fill in spots in doubles
        if (singles.size() < doubles.size())
        {
            System.out.println(-1);
            return;
        }
        
        // We can do it--print them out
        // First print all triples
        for (ArrayList<Integer> t: triples)
        {
            for (int x: t)
            {
                System.out.print((x+1) + " ");
            }
            System.out.println();
        }
        
        // Then print doubles paired with a single
        for (ArrayList<Integer> d: doubles)
        {
            for (int x: d)
            {
                System.out.print((x+1) + " ");
            }
            System.out.println(singles.remove(0)+1);
        }
        
        // Then print the rest of the singles
        for (int i=0; i<singles.size(); i++)
        {
            if (i%3 == 2)
            {
                System.out.println(singles.get(i)+1);
            }
            else
            {
                System.out.print((singles.get(i)+1) + " ");
            }
        }
    }
}