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>
using namespace std;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const long long linf = 4000000000000000000LL;
const long long inf = 1000000007;
const long double pi = 3.1415926535;
void pv(vector<int> a) {
  for (auto& x : a) cout << x << " ";
  cout << endl;
}
void pv(vector<long long> a) {
  for (auto& x : a) cout << x << " ";
  cout << endl;
}
void pv(vector<vector<int>> a) {
  for (int i = (0); i < (int(a.size())); ++i) {
    cout << i << endl;
    pv(a[i]);
    cout << endl;
  }
}
void pv(vector<vector<long long>> a) {
  for (int i = (0); i < (int(a.size())); ++i) {
    cout << i << endl;
    pv(a[i]);
  }
  cout << endl;
}
void pv(vector<string> a) {
  for (auto& x : a) cout << x << endl;
  cout << endl;
}
void build_primes(vector<int>& primes, int size) {
  vector<int> visited;
  visited.resize(size, 0);
  for (int i = (2); i < (size); ++i) {
    if (visited[i] == 0) {
      primes.push_back(i);
      int a = i;
      while (a < size) {
        visited[a] = 1;
        a += i;
      }
    }
  }
}
vector<vector<long long>> matrix_mult(vector<vector<long long>>& a,
                                      vector<vector<long long>>& b) {
  int n = a.size();
  vector<vector<long long>> answer;
  answer.resize(n);
  for (int i = 0; i < n; i++) answer[i].resize(n, 0);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      for (int k = 0; k < n; k++)
        answer[i][j] = (answer[i][j] + a[i][k] * b[k][j]) % inf;
    }
  }
  return answer;
}
int modInverse(int a, int m) {
  int m0 = m;
  int y = 0, x = 1;
  if (m == 1) return 0;
  while (a > 1) {
    int q = a / m;
    int t = m;
    m = a % m, a = t;
    t = y;
    y = x - q * y;
    x = t;
  }
  if (x < 0) x += m0;
  return x;
}
long long power(long long x, long long y) {
  long long k = 1LL << 60;
  long long z = 1;
  while (k != 0) {
    z *= z;
    z %= inf;
    if (y >= k) {
      z *= x;
      z %= inf;
      y -= k;
    }
    k >>= 1;
  }
  return z;
}
struct point {
  long double x, y;
  bool operator<(const point& rhs) const {
    if (x == rhs.x) return y < rhs.y;
    return x < rhs.x;
  }
};
struct pt {
  long long x, y;
  bool operator<(const pt& rhs) const {
    if (x == rhs.x) return y < rhs.y;
    return x < rhs.x;
  }
};
long double area(point x, point y, point z) {
  return (x.y * y.x + y.y * z.x + z.y * x.x - x.x * y.y - y.x * z.y -
          z.x * x.y) /
         2.0;
}
bool clockwise(point x, point y, point z) { return area(x, y, z) > 0; }
long double area(pt x, pt y, pt z) {
  return (x.y * y.x + y.y * z.x + z.y * x.x - x.x * y.y - y.x * z.y -
          z.x * x.y) /
         2.0;
}
bool clockwise(pt x, pt y, pt z) { return area(x, y, z) > 0; }
long long gcd(long long a, long long b) {
  if (a > b) swap(a, b);
  if (a == 0) return b;
  return gcd(a, b % a);
}
int popcount(long long a) {
  int count = 0;
  while (a) {
    count += (a & 1);
    a >>= 1;
  }
  return count;
}
long long choose(long long n, long long r) {
  long long p = 1, k = 1;
  if (n - r < r) r = n - r;
  if (r != 0) {
    while (r) {
      p *= n;
      k *= r;
      long long m = gcd(p, k);
      p /= m;
      k /= m;
      n--;
      r--;
    }
  } else
    p = 1;
  return p;
}
vector<long long> prefix_hash(string& a, vector<long long>& powers,
                              long long mod) {
  int n = int(a.size());
  vector<long long> prefix(n + 1);
  for (int i = (0); i < (n); ++i)
    prefix[i + 1] = (prefix[i] + powers[i] * (a[i] - '1' + 1)) % mod;
  return prefix;
}
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  uint64_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
struct custom_hash_fast {
  uint64_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    x ^= FIXED_RANDOM;
    return x ^ (x >> 16);
  }
};
void setIO(string second) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if (int(second.size())) {
    freopen((second + ".in").c_str(), "r", stdin);
    if (second != "test3") freopen((second + ".out").c_str(), "w", stdout);
  }
}
int n, m;
vector<vector<int>> adj;
vector<vector<int>> ans;
vector<int> v;
int timenow;
bool dfs(int i, int p) {
  v[i] = timenow;
  vector<int> curr;
  for (auto& x : adj[i]) {
    if (x == p || (v[x] == timenow && x < i)) continue;
    if (v[x]) {
      curr.push_back(x);
      if (int(curr.size()) == 2) {
        ans.push_back({curr[0], i, curr[1]});
        curr.pop_back();
        curr.pop_back();
      }
    } else if (dfs(x, i)) {
      curr.push_back(x);
      if (int(curr.size()) == 2) {
        ans.push_back({curr[0], i, curr[1]});
        curr.pop_back();
        curr.pop_back();
      }
    }
  }
  if (int(curr.size())) {
    if (p + 1) ans.push_back({curr[0], i, p});
    return 0;
  }
  return 1;
}
int main() {
  setIO("");
  cin >> n >> m;
  adj.resize(n);
  for (int i = (0); i < (m); ++i) {
    int a, b;
    cin >> a >> b;
    adj[--a].push_back(--b);
    adj[b].push_back(a);
  }
  v.resize(n);
  timenow = 1;
  for (int i = (0); i < (n); ++i) {
    if (v[i] == 0) {
      dfs(i, -1);
      timenow++;
    }
  }
  cout << int(ans.size()) << endl;
  for (auto& x : ans)
    cout << x[0] + 1 << " " << x[1] + 1 << " " << x[2] + 1 << endl;
}