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.awt.Point;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

/**
 *
 * @author Mojtaba
 */
public class Main {

    static ArrayList<Edge>[] graph;
    static boolean[] visited;

    public static void main(String[] args) throws IOException {
        MyScanner in = new MyScanner(System.in);
        PrintWriter writer = new PrintWriter(new BufferedOutputStream(System.out));
        StringBuilder sb = new StringBuilder("");

        int n = in.nextInt();
        graph = new ArrayList[n + 1];
        visited = new boolean[graph.length];
        HashMap<Integer, ArrayList<HashSet<Integer>>> map = new HashMap<>();
        for (int i = 0; i < graph.length; i++) {
            graph[i] = new ArrayList<>();
        }
        int m = in.nextInt();
        for (int i = 0; i < m; i++) {
            int from = in.nextInt();
            int to = in.nextInt();
            graph[from].add(new Edge(to));
            graph[to].add(new Edge(from));
        }
        boolean ok = true;
        for (int i = 1; i < graph.length; i++) {
            if (!visited[i]) {
                HashSet<Integer> set = new HashSet<>();
                DFS(i, set);
                if (set.size() > 3) {
                    ok = false;
                    break;
                }
                ArrayList<HashSet<Integer>> l = map.containsKey(set.size()) ? map.get(set.size()) : new ArrayList<HashSet<Integer>>();
                l.add(set);
                map.put(set.size(), l);
            }
        }
        int ones = map.containsKey(1) ? map.get(1).size() : 0;
        int twos = map.containsKey(2) ? map.get(2).size() : 0;
        ok = ok && ones >= twos;
        if (!ok) {
            sb.append("-1");
        } else {
            ArrayList<HashSet<Integer>> l3 = map.containsKey(3) ? map.get(3) : new ArrayList<HashSet<Integer>>();
            for (HashSet<Integer> set : l3) {
                StringBuilder builder = new StringBuilder();
                for (int i : set) {
                    builder.append(i).append(" ");
                }
                sb.append(builder.toString().trim()).append("\n");
            }

            ArrayList<HashSet<Integer>> l2 = map.containsKey(2) ? map.get(2) : new ArrayList<HashSet<Integer>>();
            ArrayList<HashSet<Integer>> l1 = map.containsKey(1) ? map.get(1) : new ArrayList<HashSet<Integer>>();

            for (int i = 0, j = 0; i < l2.size() || j < l1.size(); i++, j++) {
                if (i < l2.size()) {
                    HashSet<Integer> set = l2.get(i);
                    for (int integ : set) {
                        sb.append(integ).append(" ");
                    }
                    HashSet<Integer> set2 = l1.get(j);
                    for (int integ : set2) {
                        sb.append(integ).append("\n");
                    }
                } else {
                    HashSet<Integer> set1 = l1.get(j);
                    j++;
                    for (int integ : set1) {
                        sb.append(integ).append(" ");
                    }
                    HashSet<Integer> set2 = l1.get(j);
                    j++;
                    for (int integ : set2) {
                        sb.append(integ).append(" ");
                    }
                    HashSet<Integer> set3 = l1.get(j);
                    for (int integ : set3) {
                        sb.append(integ).append("\n");
                    }
                }
            }
        }

        //System.out.println(sb.toString().trim());
        writer.println(sb.toString().trim());
        writer.flush();
        in.close();
    }

    static void DFS(int v, HashSet<Integer> set) {
        if (visited[v]) {
            return;
        }
        set.add(v);
        visited[v] = true;
        for (Edge edge : graph[v]) {
            if (!visited[edge.to]) {
                DFS(edge.to, set);
            }
        }
    }
}

class Edge {

    int to;

    public Edge(int to) {
        this.to = to;
    }
}

class MyScanner {

    BufferedReader reader;
    StringTokenizer tokenizer;

    public MyScanner(InputStream stream) {
        this.reader = new BufferedReader(new InputStreamReader(stream));
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public int[] nextIntegerArray(int n) throws IOException {
        int[] a = new int[n];
        for (int i = 0; i < a.length; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public long[] nextLongArray(int n) throws IOException {
        long[] a = new long[n];
        for (int i = 0; i < a.length; i++) {
            a[i] = nextLong();
        }
        return a;
    }

    public int nextInt(int radix) throws IOException {
        return Integer.parseInt(next(), radix);
    }

    public long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    public long nextLong(int radix) throws IOException {
        return Long.parseLong(next(), radix);
    }

    public double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public BigInteger nextBigInteger() throws IOException {
        return new BigInteger(next());
    }

    public BigInteger nextBigInteger(int radix) throws IOException {
        return new BigInteger(next(), radix);
    }

    public String next() throws IOException {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
            return this.next();
        }
        return tokenizer.nextToken();
    }

    public void close() throws IOException {
        this.reader.close();
    }
}