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.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.stream.Stream;
import java.util.Vector;

import static java.lang.Math.*;

public class icpc
{
    static ArrayList<Long> A = new ArrayList<>();
    public static void main(String[] args)throws IOException
    {
        Reader in = new Reader();
        int n = in.nextInt();
        int m = in.nextInt();
        ArrayList<Integer>[] adj = (ArrayList<Integer>[])new ArrayList[n];
        for(int i=0;i<n;i++)
            adj[i] = new ArrayList<>();

        for(int i=0;i<m;i++)
        {
            int a = in.nextInt();
            int b = in.nextInt();
            adj[a-1].add(b-1);
            adj[b-1].add(a-1);
        }

        ArrayList<Integer> ones = new ArrayList<>();



        boolean[] visited1 = new boolean[n];
        for(int i=0;i<n;i++)
        {
            if(!visited1[i])
            {
                ArrayList<Integer> nodes = new ArrayList<>();
                int count = explore(adj,i,visited1,nodes);
                if(count == 1)
                {
                    ones.add(i);
                }
            }
        }














        boolean[] visited = new boolean[n];
        boolean flag = true;
        StringBuilder stringBuilder = new StringBuilder();




        for(int i=0;i<n;i++)
        {
            if(!visited[i])
            {
                ArrayList<Integer> nodes = new ArrayList<>();
                int count = explore(adj,i,visited,nodes);
                if(count > 3)
                {
                    flag = false;
                    break;
                }
                else if(count > 1)
                {
                    for(int j=0;j<nodes.size();j++)
                        stringBuilder.append(nodes.get(j)+1).append(" ");
                    for(int j=0;j<(3- count);j++)
                    {
                        if(ones.size() == 0)
                        {
                            flag = false;
                            break;
                        }
                        stringBuilder.append(ones.get(0)+1).append(" ");
                        ones.remove(0);
                    }
                    stringBuilder.append("\n");
                }
            }
        }
        int x = ones.size();
        for(int i=0;i<x/3;i++)
        {
            stringBuilder.append(ones.get(0)+1).append(" ");
            ones.remove(0);
            stringBuilder.append(ones.get(0)+1).append(" ");
            ones.remove(0);
            stringBuilder.append(ones.get(0)+1).append(" ");
            ones.remove(0);
            stringBuilder.append("\n");
        }
        if(flag)
            System.out.println(stringBuilder);
        else
            System.out.println("-1");
    }
    public static int explore(ArrayList<Integer>[] adj,int v,boolean[] visited,ArrayList<Integer> nodes)
    {
        visited[v] = true;
        nodes.add(v);
        int count = 0;
        for(int i=0;i<adj[v].size();i++)
        {
            if(!visited[adj[v].get(i)])
                count += explore(adj,adj[v].get(i),visited,nodes);
        }
        return (count + 1);
    }
}
class Solver
{
    public String solve(int[] A)
    {
        int n = A.length;
        Point[] arr = new Point[n-1];

        for(int i=0;i<n-1;i++)
        {
            arr[i] = new Point(A[i],A[i+1]);
        }

        for(int i=0;i<arr.length;i++)
        {
            for(int j=0;j<arr.length;j++)
            {
                if(i!=j)
                {
                    if(checkCrossIntersection(Math.min(arr[i].x,arr[i].y) ,Math.max(arr[i].y,arr[i].x),Math.min(arr[j].x,arr[j].y) ,Math.max(arr[j].y,arr[j].x)))
                        return "yes";
                    else
                        continue;
                }
            }
        }
        return "no";
    }
    public boolean checkCrossIntersection(int x1,int x2,int x3,int x4)
    {
        if((x1 < x3 && x3 < x2 && x2 < x4) || (x3 < x1 && x1 < x4 && x4 < x2))
            return true;
        return false;
    }
}
class Point implements Comparable<Point>
{
    int x;
    int y;
    Point(int a ,int b)
    {
        this.x = a;
        this.y = b;
    }
    public int compareTo(Point ob)
    {
        if(ob.x < this.x)
            return 1;
        else if(ob.x > this.x)
            return -1;
        else
            return 0;
    }
}
class MergeSort
{
    // Merges two subarrays of arr[].
    // First subarray is arr[l..m]
    // Second subarray is arr[m+1..r]
    void merge(int arr[], int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        int L[] = new int [n1];
        int R[] = new int [n2];

        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];


        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    // Main function that sorts arr[l..r] using
    // merge()
    void sort(int arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }
}
class Node
{
    int x;
    Node(int a)
    {
        this.x = a;
    }
    @Override
    public boolean equals(Object ob)
    {
        if(ob == null)
            return false;
        if(!(ob instanceof Node))
            return false;
        if(ob == this)
            return true;
        Node obj = (Node)ob;
        if(obj.x == this.x)
            return true;
        return false;
    }
    @Override
    public int hashCode()
    {
        return (int)this.x;
    }
}
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();
    }
}