Problem: All Berland residents are waiting for an unprecedented tour of wizard in his Blue Helicopter over the cities of Berland!

It is well-known that there are n cities in Berland, some pairs of which are connected by bidirectional roads. Each pair of cities is connected by no more than one road. It is not guaranteed that the road network is connected, i.e. it is possible that you can't reach some city from some other.

The tour will contain several episodes. In each of the episodes:

  * the wizard will disembark at some city x from the Helicopter; 
  * he will give a performance and show a movie for free at the city x; 
  * he will drive to some neighboring city y using a road; 
  * he will give a performance and show a movie for free at the city y; 
  * he will drive to some neighboring to y city z; 
  * he will give a performance and show a movie for free at the city z; 
  * he will embark the Helicopter and fly away from the city z. 



It is known that the wizard doesn't like to use roads, so he agrees to use each road at most once (regardless of direction). In other words, for road between a and b he only can drive once from a to b, or drive once from b to a, or do not use this road at all.

The wizards wants to plan as many episodes as possible without violation the above rules. Help the wizard!

Please note that the wizard can visit the same city multiple times, the restriction is on roads only.

Input

The first line contains two integers n, m (1 ≤ n ≤ 2·105, 0 ≤ m ≤ 2·105) — the number of cities and the number of roads in Berland, respectively.

The roads description follow, one in each line. Each description is a pair of two integers ai, bi (1 ≤ ai, bi ≤ n, ai ≠ bi), where ai and bi are the ids of the cities connected by the i-th road. It is guaranteed that there are no two roads connecting the same pair of cities. Every road is bidirectional. The cities are numbered from 1 to n.

It is possible that the road network in Berland is not connected.

Output

In the first line print w — the maximum possible number of episodes. The next w lines should contain the episodes in format x, y, z — the three integers denoting the ids of the cities in the order of the wizard's visits.

Examples

Input

4 5
1 2
3 2
2 4
3 4
4 1


Output

2
1 4 2
4 3 2


Input

5 8
5 3
1 2
4 5
5 1
2 5
4 3
1 4
3 2


Output

4
1 4 5
2 3 4
1 5 3
5 2 1

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

public class SolverC {

    public static void main(String[] args) throws IOException {
        new SolverC().Run();
    }

    BufferedReader br;
    PrintWriter pw;
    StringTokenizer stok;

    private String nextToken() throws IOException {
        while (stok == null || !stok.hasMoreTokens()) {
            stok = new StringTokenizer(br.readLine());
        }
        return stok.nextToken();
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    private double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    private void Run() throws IOException {
//        br = new BufferedReader(new FileReader("input.txt"));
//        pw = new PrintWriter("output.txt");
        br=new BufferedReader(new InputStreamReader(System.in));
        pw=new PrintWriter(new OutputStreamWriter(System.out));

        solve();
        pw.flush();
        pw.close();
    }

    int n, m;

    class Edge {
        int n1, n2;
        boolean used = false;

        public Edge(int n1, int n2) {
            this.n1 = n1;
            this.n2 = n2;
        }

        int to(int from) {
            if (from == n1) {
                return n2;
            } else {
                return n1;
            }
        }
    }

    List<List<Edge>> edges;
    boolean[] visited;
    List<Integer[]> ans = new ArrayList<>();

    private void solve() throws IOException {
        int n = nextInt();
        int m = nextInt();
        visited = new boolean[n];
        edges = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            edges.add(new ArrayList<>());
        }
        for (int i = 0; i < m; i++) {
            int n1 = nextInt() - 1;
            int n2 = nextInt() - 1;
            Edge edge = new Edge(n1, n2);
            edges.get(n1).add(edge);
            edges.get(n2).add(edge);
        }
        for (int i = 0; i < n; i++) {
            if (!visited[i]) {
                depth(i);
            }
        }
        pw.println(ans.size());
        for (Integer[] mas : ans) {
            pw.println((mas[0] + 1) + " " + (mas[1] + 1) + " " + (mas[2] + 1));
        }
    }

    private List<Integer> depth(int cur) {
        visited[cur] = true;
        List<Integer> tails = new ArrayList<>();
        for (Edge edge : edges.get(cur)) {
            if (!edge.used) {
                edge.used = true;
                List<Integer> returned = depth(edge.to(cur));
                if (returned.size() == 2) {
                    ans.add(new Integer[]{cur, returned.get(0), returned.get(1)});
                } else {
                    tails.addAll(returned);
                }
            }
        }
        for (int i = 0; i < tails.size() / 2; i++) {
            ans.add(new Integer[]{tails.get(i * 2), cur, tails.get(i * 2 + 1)});
        }
        List<Integer> result = new ArrayList<>();
        result.add(cur);
        if (tails.size() % 2 == 1) {
            result.add(tails.get(tails.size() - 1));
        }
        return result;
    }

}