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 CPP):

Solution:
#include <bits/stdc++.h>
#pragma comment(linker, “/ STACK : 1024000000, 1024000000”)
using namespace std;
const int MAXM = 2e5 + 10;
const int MAXN = 2e5 + 10;
int n, m;
struct edge {
  int u, v;
  int next;
} e[MAXM * 2];
int vis[MAXM * 2];
int visv[MAXN];
int first[MAXN];
int deg[MAXN];
int fa[MAXN];
int idx, num;
struct node {
  int x, y, z;
} ans[MAXM];
void add(int u, int v) {
  e[idx].u = u;
  e[idx].v = v;
  e[idx].next = first[u];
  first[u] = idx++;
}
void init() {
  fill(first, first + n + 1, -1);
  fill(deg, deg + n + 1, 0);
  fill(visv, visv + n + 1, 0);
  memset(vis, 0, sizeof(vis));
  idx = 0;
  num = 0;
}
void dfs(int x, int p) {
  visv[x] = 1;
  fa[x] = p;
  for (int i = first[x]; i != -1; i = e[i].next) {
    int v = e[i].v;
    if (v == p) continue;
    if (visv[v]) continue;
    dfs(v, x);
  }
  if (deg[x] == 1 || deg[x] == 0) {
    return;
  }
  if (deg[x] % 2 == 1) {
    for (int i = first[x]; i != -1; i = e[i].next) {
      if (vis[i]) continue;
      int v = e[i].v;
      if (v == fa[x]) continue;
      vis[i] = vis[i ^ 1] = 1;
      deg[v]--;
      num++;
      if (num % 2 == 0) {
        ans[num / 2].y = x;
        ans[num / 2].z = v;
      } else {
        ans[(num + 1) / 2].x = v;
      }
    }
  } else {
    for (int i = first[x]; i != -1; i = e[i].next) {
      if (vis[i]) continue;
      vis[i] = vis[i ^ 1] = 1;
      int v = e[i].v;
      deg[v]--;
      num++;
      if (num % 2 == 0) {
        ans[num / 2].y = x;
        ans[num / 2].z = v;
      } else {
        ans[(num + 1) / 2].x = v;
      }
    }
  }
}
int f[MAXN];
int find(int x) {
  if (f[x] == x) return x;
  return f[x] = find(f[x]);
}
int main() {
  scanf("%d%d", &n, &m);
  init();
  for (int i = 1; i <= n; i++) f[i] = i;
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
    deg[u]++;
    deg[v]++;
    int fu = find(u);
    int fv = find(v);
    if (fu != fv) {
      f[fu] = fv;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (f[i] == i) {
      dfs(i, 0);
      if (num % 2 == 1) num--;
    }
  }
  printf("%d\n", num / 2);
  for (int i = 1; i <= num / 2; i++) {
    printf("%d %d %d\n", ans[i].x, ans[i].y, ans[i].z);
  };
  return 0;
};