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.util.*;

public class Coach {
    
    static boolean[][] adj;
    static int[] groupId;
    
    static boolean dfs(int u, int g) {
        groupId[u] = g;
        for (int v = 0; v < adj.length; v++) {
            if (adj[u][v]) {
                if (groupId[v] >= 0 && groupId[v] != g) {
                    return false;
                } else if (groupId[v] == -1) {
                    if (!dfs(v, g)) {
                        return false;
                    }
                }
            }
        }
        return true;
    }
    
    static void solve1(int n, int m) {
        boolean ok = true;
        groupId = new int[n];
        Arrays.fill(groupId, -1);
        int groupCount = 0;
        for (int i = 0; i < n; i++) {
            if (groupId[i] == -1) {
                if (!dfs(i, groupCount++)) {
                    ok = false;
                    break;
                }
            }
        }
        if (ok) {
            List<List<Integer>> groups = new ArrayList<>();
            for (int i = 0; i < groupCount; i++) {
                groups.add(new ArrayList<Integer>());
            }
            for (int i = 0; i < n; i++) {
                groups.get(groupId[i]).add(i);
            }
            Map<Integer, List<List<Integer>>> groupsPerSize = new HashMap<>();
            for (int size = 1; size <= 3; size++) {
                groupsPerSize.put(size, new ArrayList<>());
            }
            for (List<Integer> group : groups) {
                int size = group.size();
                if (size == 0) continue;
                if (size > 3) {
                    ok = false;
                    break;
                }
                groupsPerSize.get(size).add(group);
            }
            if (ok && groupsPerSize.get(2).size() > groupsPerSize.get(1).size()) {
                ok = false;
            }
            if (ok) {
                List<List<Integer>> ans = new ArrayList<>();
                for (List<Integer> groupThree : groupsPerSize.get(3)) {
                    ans.add(groupThree);
                }
                for (int i = 0; i < groupsPerSize.get(2).size(); i++) {
                    List<Integer> group = groupsPerSize.get(2).get(i);
                    group.add(groupsPerSize.get(1).get(i).get(0));
                    ans.add(group);
                }
                for (int i = groupsPerSize.get(2).size(); i < groupsPerSize.get(1).size(); i += 3) {
                    List<Integer> group = new ArrayList<>();
                    for (int j = i; j < i + 3; j++) {
                        group.add(groupsPerSize.get(1).get(j).get(0));
                    }
                    ans.add(group);
                }
                for (List<Integer> group : ans) {
                    System.out.println((group.get(0) + 1) + " " + (group.get(1) + 1) + " " + (group.get(2) + 1));
                }
            }
        }
        if (!ok) {
            System.out.println(-1);
        }
    }
    
    static void solve(int n, int m) {
        boolean ok = true;
        for (int a = 0; a < n; a++) {
            for (int b = a + 1; b < n; b++) {
                if (!adj[a][b]) continue;
                for (int c = b + 1; c < n; c++) {
                    if (!adj[a][c] || !adj[b][c]) continue;
                    for (int d = c + 1; d < n; d++) {
                        if (adj[d][a] && adj[d][b] && adj[d][c]) {
                            ok = false;
                        }
                    }
                }
            }
        }
        if (ok) {
            int[][] groups = new int[n / 3][3];
            boolean[] seen = new boolean[n];
            for (int[] arr : groups) Arrays.fill(arr, -1);
            int index = 0;
            for (int a = 0; a < n; a++) {
                if (seen[a]) continue;
                for (int b = a + 1; b < n; b++) {
                    if (seen[b]) continue;
                    if (!adj[a][b]) continue;
                    for (int c = b + 1; c < n; c++) {
                        if (seen[c]) continue;
                        if (adj[a][c] && adj[b][c]) {
                            groups[index++] = new int[]{a, b, c};
                            seen[a] = seen[b] = seen[c] = true;
                        }
                    }
                }
            }
            for (int a = 0; a < n; a++) {
                if (seen[a]) continue;
                for (int b = a + 1; b < n; b++) {
                    if (seen[b]) continue;
                    if (adj[a][b]) {
                        if (index >= groups.length) {
                            ok = false;
                        } else {
                            groups[index++] = new int[]{a, b, -1};
                            seen[a] = seen[b] = true;
                        }
                    }
                }
            }
            for (int a = 0; a < n; a++) {
                if (seen[a]) continue;
                for (int i = 0; i < n / 3 && !seen[a]; i++) {
                    for (int j = 0; j < 3 && !seen[a]; j++) {
                        if (groups[i][j] == -1) {
                            groups[i][j] = a;
                            seen[a] = true;
                        }
                    }
                }
            }
            for (int i = 0; i < n / 3; i++) {
                for (int j = 0; j < 3; j++) {
                    if (groups[i][j] == -1) {
                        ok = false;
                    }
                }
            }
            if (ok) {
                for (int[] group : groups) {
                    System.out.println((group[0] + 1) + " " + (group[1] + 1) + " " + (group[2] + 1));
                }
            } else {
                System.out.println(-1);
            }
        } else {
            System.out.println(-1);
        }
    }
    
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        
        int n = in.nextInt();
        int m = in.nextInt();
        adj = new boolean[n][n];
        for (int i = 0; i < m; i++) {
            int a = in.nextInt() - 1;
            int b = in.nextInt() - 1;
            adj[a][b] = adj[b][a] = true;
        }
        solve(n, m);
        
        in.close();
        System.exit(0);
    }
}