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 
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.Comparator;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.List;
import java.io.IOException;
import java.util.InputMismatchException;
import java.util.ArrayList;
import java.util.NoSuchElementException;
import java.math.BigInteger;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Nguyen Trung Hieu - vuondenthanhcong11@yahoo.com
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskB {
    boolean noAnswer = false;
    int curIdx = 0;

    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int count = in.readInt();
        int likeCount = in.readInt();
        int[] from = new int[likeCount];
        int[] to = new int[likeCount];
        IOUtils.readIntArrays(in, from, to);
        boolean[] used = new boolean[count];

        MiscUtils.decreaseByOne(from, to);
        int[][] graph = GraphUtils.buildSimpleGraph(count, from, to);

        boolean[] visited = new boolean[count];
        int[][] answer = new int[count / 3][5];
        int[] sizeAnswer = new int[count / 3];
        for (int i = 0; i < count; i++) {
            if (!visited[i])
                findAnswer(i, graph, visited, answer, sizeAnswer, i);
        }

        if (noAnswer) {
            out.printLine(-1);
            return;
        }

        for (int i = 0; i < count; i++) {
            if (!visited[i]) {
                for (int j = 0; j < count / 3; j++) {
                    if (sizeAnswer[j] < 3) {
                        answer[j][sizeAnswer[j]++] = i;
                        break;
                    }
                }
            }
        }

        for (int i = 0; i < count / 3; i++) {
            for (int j = 0; j < sizeAnswer[i]; j++)
                out.print((answer[i][j] + 1) + " ");
            out.printLine();
        }
    }

    private void findAnswer(int x, int[][] graph, boolean[] visited, int[][] answer, int[] sizeAnswer, int goc) {
        if (noAnswer)
            return;
        if (visited[x])
            return;
        if (graph[goc].length <= 0)
            return;
        if (curIdx >= graph.length / 3 || sizeAnswer[curIdx] >= 3) {
            noAnswer = true;
            return;
        }
        answer[curIdx][sizeAnswer[curIdx]++] = x;
        visited[x] = true;
        for (int y : graph[x]) {
            if (!visited[y]) {
                if (sizeAnswer[curIdx] >= 3) {
                    noAnswer = true;
                    return;
                }
                answer[curIdx][sizeAnswer[curIdx]++] = y;
                visited[y] = true;
                findAnswer(y, graph, visited, answer, sizeAnswer, goc);
            }
        }
        if (x == goc) {
            curIdx++;
        }
    }
}

class InputReader {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }

    }

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object...objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

}

class IOUtils {

    public static void readIntArrays(InputReader in, int[]... arrays) {
        for (int i = 0; i < arrays[0].length; i++) {
            for (int j = 0; j < arrays.length; j++)
                arrays[j][i] = in.readInt();
        }
    }

    }

class MiscUtils {

    public static void decreaseByOne(int[]...arrays) {
        for (int[] array : arrays) {
            for (int i = 0; i < array.length; i++)
                array[i]--;
        }
    }
}

class GraphUtils {
    public static int[][] buildGraph(int vertexCount, int[] from, int[] to) {
        int edgeCount = from.length;
        int[] degree = new int[vertexCount];
        for (int i = 0; i < edgeCount; i++) {
            degree[from[i]]++;
            degree[to[i]]++;
        }
        int[][] graph = new int[vertexCount][];
        for (int i = 0; i < vertexCount; i++)
            graph[i] = new int[degree[i]];
        for (int i = 0; i < edgeCount; i++) {
            graph[from[i]][--degree[from[i]]] = i;
            graph[to[i]][--degree[to[i]]] = i;
        }
        return graph;
    }

    public static int otherVertex(int vertex, int from, int to) {
        return from + to - vertex;
    }

    public static int[][] buildSimpleGraph(int vertexCount, int[] from, int[] to) {
        int[][] graph = buildGraph(vertexCount, from, to);
        simplifyGraph(from, to, graph);
        return graph;
    }

    private static void simplifyGraph(int[] from, int[] to, int[][] graph) {
        for (int i = 0; i < graph.length; i++) {
            for (int j = 0; j < graph[i].length; j++) {
                graph[i][j] = otherVertex(i, from[graph[i][j]], to[graph[i][j]]);
            }
        }
    }

    }
