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


public class Main {
    static PrintWriter out=new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        //BufferedReader reader=new BufferedReader(new FileReader("input.txt"));
        //PrintWriter pw=new PrintWriter(new BufferedWriter(new FileWriter("output.txt")));
        //BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        //Scanner scanner=new Scanner(System.in);
        Reader in = new Reader();

        int n=in.nextInt();
        int m=in.nextInt();
        int[] p=new int[n+1];
        int[] level=new int[n+1];
        for (int i = 1; i <=n ; i++) {
            p[i]=i;
            level[i]=1;
        }
        for (int i = 1; i <=m ; i++) {
            int a=in.nextInt(),b=in.nextInt();
            union(a,b,p,level);
        }
        //System.out.println(Arrays.toString(p));
        Queue<Integer> queue=new LinkedList<>();
        for (int i = 1; i <=n ; i++) {
            if (p[i]==i){
                if (level[i]==1)
                    queue.add(i);
                if (level[i]>3){
                    System.out.println(-1);
                    return;
                }
            }
        }
       // System.out.println(queue);
        for (int i = 1; i <=n ; i++) {
            if (p[i]==i && level[i]!=1){
                for (int j = 1; j <=n ; j++) {
                    if (p[j]==i){
                        p[j]=-1;
                        out.print(j+" ");
                    }
                }
                for (int j = 0; j <3-level[i] ; j++) {
                    if (queue.size()==0){
                        System.out.println(-1);
                        return;
                    }
                    out.print(queue.poll()+" ");
                }
                out.print("\n");
            }
        }
        while (!queue.isEmpty())
            out.println(queue.poll()+" "+queue.poll()+" "+queue.poll());









        out.close();

    }
    static long nextLucky(long n){
        char[] s=String.valueOf(n).toCharArray();
        for (int i = s.length-1; i >=0 ; i--) {
            if (s[i]=='4'){
                s[i]='7';
                for (int j = i+1; j <s.length ; j++) {
                    s[j]='4';
                }
                break;
            }
            else if (i==0){
                Arrays.fill(s,'4');
                return Long.parseLong("4"+String.valueOf(s));
            }
        }
        return Long.parseLong(String.valueOf(s));
    }
    static boolean isLucky(long n){
        char[] s=String.valueOf(n).toCharArray();
        int four=0,seven=0;
        for (int i = 0; i <s.length ; i++) {
            if (s[i]!='4' && s[i]!='7')
                return false;
            if (s[i]=='4')four++;
            if (s[i]=='7')seven++;
        }

        return four==seven;

    }
    static int kadens(int[] a,int x){
        int maxSoFar=0;
        int maxEndHere=0;
        int count=0;
        boolean found=false;
        for (int i = 0; i <a.length ; i++) {
            maxEndHere+=a[i];
            count++;
            if (maxEndHere%x==0){
                maxEndHere=a[i];
                count=1;
            }
            else
                found=true;

            if (maxSoFar<count)
                maxSoFar=count;
        }
        if (found)
            return maxSoFar;
        else
            return -1;
    }
    static int gcd(int a,int b){
        if (b==0)
            return a;
        return gcd(b,a%b);

    }
    static boolean ok(int n){
        if (n%2==0 || n%3==0 || n%5==0)
            return true;
        else
            return false;
    }




    static int find(int n,int[] p){
        if (p[n]==n)return n;
        return p[n]=find(p[n],p);
    }
    static void union(int a,int b,int[] p,int[] level){
        int aRoot=find(a,p);
        int bRoot=find(b,p);
        if (aRoot==bRoot)return;
        p[bRoot]=aRoot;
        level[aRoot]+=level[bRoot];
    }
}
class node implements Comparable<node>{
    Integer no;
    Integer cost;
    Vector<node> adj=new Vector<>();
    public node(Integer no, Integer cost) {
        this.no = no;
        this.cost = cost;
    }

    @Override
    public String toString() {
        return "node{" +
                "no=" + no +
                ", cost=" + cost +
                '}';
    }

    @Override
    public int compareTo(node o) {
        return o.cost-this.cost;
    }
}
class edge implements Comparable<edge>{
    tuple u;
    Double cost;
    public edge(tuple u, Double cost) {
        this.u = u;
        this.cost = cost;
    }
    @Override
    public int compareTo(edge o) {
        return this.cost.compareTo(o.cost);
    }

    @Override
    public String toString() {
        return "edge{" +
                "u=" + u +
                ", cost=" + cost +
                '}';
    }
}
///*
class tuple implements Comparable<tuple>{
    int a;
    int b;
    tuple(int a, int b) {
        this.a = a;
        this.b = b;
    }

    @Override
    public int compareTo(tuple o) {
        return (this.a-o.a);
    }

    @Override
    public String toString() {
        return "tuple{" +
                "a=" + a +
                ", b=" + b +
                '}';
    }
}

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