Problem: BubbleSquare social network is celebrating 13^{th} anniversary and it is rewarding its members with special edition BubbleSquare tokens. Every member receives one personal token. Also, two additional tokens are awarded to each member for every friend they have on the network. Yet, there is a twist – everyone should end up with different number of tokens from all their friends. Each member may return one received token. Also, each two friends may agree to each return one or two tokens they have obtained on behalf of their friendship.

Input

First line of input contains two integer numbers n and k (2 ≤ n ≤ 12500, 1 ≤ k ≤ 1000000) - number of members in network and number of friendships.

Next k lines contain two integer numbers a_i and b_i (1 ≤ a_i, b_i ≤ n, a_i ≠ b_i) - meaning members a_i and b_i are friends.

Output

First line of output should specify the number of members who are keeping their personal token.

The second line should contain space separated list of members who are keeping their personal token.

Each of the following k lines should contain three space separated numbers, representing friend pairs and number of tokens each of them gets on behalf of their friendship.

Examples

Input


2 1
1 2


Output


1
1 
1 2 0


Input


3 3
1 2
1 3
2 3


Output


0
1 2 0
2 3 1
1 3 2

Note

In the first test case, only the first member will keep its personal token and no tokens will be awarded for friendship between the first and the second member.

In the second test case, none of the members will keep their personal token. The first member will receive two tokens (for friendship with the third member), the second member will receive one token (for friendship with the third member) and the third member will receive three tokens (for friendships with the first and the second member).

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <typename T>
void chmin(T &x, const T &y) {
  if (x > y) x = y;
}
template <typename T>
void chmax(T &x, const T &y) {
  if (x < y) x = y;
}
int read() {
  char c;
  while ((c = getchar()) < '-')
    ;
  if (c == '-') {
    int x = (c = getchar()) - '0';
    while ((c = getchar()) >= '0') x = x * 10 + c - '0';
    return -x;
  }
  int x = c - '0';
  while ((c = getchar()) >= '0') x = x * 10 + c - '0';
  return x;
}
const int N = 12500 + 5, M = 1e6 + 5;
struct Edge {
  int to, id;
};
vector<Edge> lk[N];
pair<int, int> e[M];
int s[N], ans[M];
bool w[N], mark[N];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) s[i] = w[i] = 1;
  for (int i = 1; i <= m; ++i) {
    int x = read(), y = read();
    e[i] = {x, y};
    if (x > y) swap(x, y);
    lk[y].push_back({x, i});
    ++s[x];
    ++s[y];
    ans[i] = 1;
  }
  for (int x = 1; x <= n; ++x) {
    int c1 = 0, m = lk[x].size();
    for (const auto &e : lk[x]) c1 += w[e.to];
    int c0 = m - c1;
    for (int i = 0; i <= m; ++i) mark[i] = 0;
    int p = s[x];
    for (const auto &e : lk[x])
      if (s[e.to] >= p - c0 && s[e.to] <= p + c1) mark[s[e.to] - (p - c0)] = 1;
    int r = 0;
    while (mark[r]) ++r;
    r -= c0;
    s[x] += r;
    for (const auto &e : lk[x])
      if (r > 0 && w[e.to]) {
        --r;
        w[e.to] = 0;
        ans[e.id] = 2;
      } else if (r < 0 && !w[e.to]) {
        ++r;
        w[e.to] = 1;
        ans[e.id] = 0;
      }
  }
  int c1 = 0;
  for (int i = 1; i <= n; ++i) c1 += w[i];
  printf("%d\n", c1);
  if (c1) {
    for (int i = 1; i <= n; ++i)
      if (w[i]) printf("%d%c", i, " \n"[--c1 == 0]);
  }
  for (int i = 1; i <= m; ++i)
    printf("%d %d %d\n", e[i].first, e[i].second, ans[i]);
}