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:
/*
Some say the world will end in fire,
Some say in ice.
From what I've tasted of desire
I hold with those who favor fire.
But if it had to perish twice,
I think I know enough of hate
To say that for destruction ice
Is also great
And would suffice.
*/
import java.io.*;
import java.lang.reflect.Array;
import java.util.*;
 
public final class Main{

    public static final long MOD = 1000000007;
    public static final int limit = 500005;
    
    public static long GCD(long a, long b) {
        while(b != 0){
            long temp = a;
            a = b;
            b = temp % b;
        }
        return a;
    }
    
    static class InputReader {
 
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;
 
        public InputReader(InputStream stream) {
            this.stream = stream;
        }
 
        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
 
        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }
 
        public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }
 
        public String nextLine() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }
 
        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
 
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

    public static void DFS(ArrayList< ArrayList<Integer> > g, boolean[] vis, int u, ArrayList<Integer> path){
        vis[u] = true;
        path.add(u);
        for(int v : g.get(u)){
            if(!vis[v]){
                DFS(g, vis, v, path);
            }
        }
    }
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);
 
        //int t = in.nextInt();
        int t = 1;
        while (t-- > 0) {
            if (System.getProperty("ONLINE_JUDGE") == null) w.println("=========================================");
            int n = in.nextInt();
            int m = in.nextInt();
            ArrayList< ArrayList<Integer> > graph = new ArrayList<ArrayList<Integer>>(n + 1);
            for(int i = 0; i <= n; i++){
                graph.add(new ArrayList<Integer>());
            }
            if(m == 0){
                for(int i = 1; i <= n; i++){
                    w.print(i + " ");
                    if(i % 3 == 0){
                        w.println();
                    }
                }
                continue;
            }

            for(int i = 0; i < m; i++){
                int a = in.nextInt();
                int b = in.nextInt();
                graph.get(a).add(b);
                graph.get(b).add(a);
            }

            boolean[] vis = new boolean[n + 1];

            boolean isPossible = true;
            ArrayList< ArrayList<Integer> > singleGroup = new ArrayList<ArrayList<Integer>>();
            ArrayList< ArrayList<Integer> > doubleGroup = new ArrayList<ArrayList<Integer>>();
            ArrayList< ArrayList<Integer> > tripleGroup = new ArrayList<ArrayList<Integer>>();
            for(int i = 1; i <= n; i++){
                if(!vis[i]){
                    ArrayList<Integer> group = new ArrayList<Integer>(); 
                    DFS(graph, vis, i, group);
                    switch(group.size()){
                        case 1:
                            singleGroup.add(group);
                            break;
                        case 2:
                            doubleGroup.add(group);
                            break;
                        case 3:
                            tripleGroup.add(group);
                            break;
                        default:
                            isPossible = false;
                            break;
                    }
                }
            }
            if(!isPossible || doubleGroup.size() > singleGroup.size()){
                w.println("-1");
            }
            else{
                ArrayList< ArrayList<Integer> > finalGroup = new ArrayList<ArrayList<Integer>>();

                for(ArrayList<Integer> g : tripleGroup)     finalGroup.add(g);

                int i = 0;
                for(ArrayList<Integer> g : doubleGroup){
                    ArrayList<Integer> grp = new ArrayList<Integer>();
                    grp.addAll(g);
                    grp.addAll(singleGroup.get(i++));
                    finalGroup.add(grp);
                }

                int count = 0;
                ArrayList<Integer> grp = new ArrayList<Integer>();
                for( ; i < singleGroup.size(); i++){
                    grp.addAll(singleGroup.get(i));
                    count++;
                    if(count % 3 == 0){
                        finalGroup.add(grp);
                        grp = new ArrayList<Integer>();
                    }
                }
                
                //int totalGroup = finalGroup.size();
                //w.println(totalGroup);
                for(ArrayList<Integer> g : finalGroup){
                    for(int x : g){
                        w.print(x + " ");
                    }
                    w.println();
                }
            }
        }
        w.close();
    }
}