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;
namespace io {
char ibuf[(1 << 20)], *iS, *iT, obuf[(1 << 20)],
    *oS = obuf, *oT = oS + (1 << 20) - 1, c, qu[55];
int f, qr;
inline void flush(void) {
  return fwrite(obuf, 1, oS - obuf, stdout), oS = obuf, void();
}
inline char getch(void) {
  return (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, (1 << 20), stdin),
                      (iS == iT ? EOF : *iS++))
                   : *iS++);
}
inline void putch(char x) {
  *oS++ = x;
  if (oS == oT) flush();
  return;
}
string getstr(void) {
  string s = "";
  char c = getch();
  while (c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == EOF)
    c = getch();
  while (!(c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == EOF))
    s.push_back(c), c = getch();
  return s;
}
void putstr(string str, int begin = 0, int end = -1) {
  if (end == -1) end = str.size();
  for (register int i = begin; i < end; i++) putch(str[i]);
  return;
}
template <typename T>
inline T read() {
  register T x = 0;
  for (f = 1, c = getch(); c < '0' || c > '9'; c = getch())
    if (c == '-') f = -1;
  for (x = 0; c <= '9' && c >= '0'; c = getch()) x = x * 10 + (c & 15);
  return x * f;
}
template <typename T>
inline void write(const T& t) {
  register T x = t;
  if (!x) putch('0');
  if (x < 0) putch('-'), x = -x;
  while (x) qu[++qr] = x % 10 + '0', x /= 10;
  while (qr) putch(qu[qr--]);
  return;
}
struct Flusher_ {
  ~Flusher_() { flush(); }
} io_flusher_;
}  // namespace io
using io::getch;
using io::getstr;
using io::putch;
using io::putstr;
using io::read;
using io::write;
vector<vector<pair<int, int> > > graph;
int from[1000005], to[1000005];
int v[12505], w[1000005], val[12505];
bool vis[1000005 << 1];
int main() {
  int n = read<int>(), k = read<int>();
  graph.resize(n + 1);
  for (register int i = 1; i <= k; i++) {
    from[i] = read<int>(), to[i] = read<int>(), w[i] = 1, val[from[i]]++,
    val[to[i]]++;
    graph[max(from[i], to[i])].push_back(
        (pair<int, int>){min(from[i], to[i]), i});
  }
  for (register int i = 1; i <= n; i++) {
    for (vector<pair<int, int> >::iterator j = graph[i].begin();
         j != graph[i].end(); j++) {
      if (!v[j->first]) v[j->first]++, w[j->second]--, val[i]--;
      vis[val[j->first]] = true;
    }
    for (vector<pair<int, int> >::iterator j = graph[i].begin();
         j != graph[i].end() && vis[val[i]]; j++)
      v[j->first]--, w[j->second]++, val[i]++;
    for (vector<pair<int, int> >::iterator j = graph[i].begin();
         j != graph[i].end(); j++)
      vis[val[j->first]] = false;
  }
  static vector<int> answer;
  answer.clear();
  for (register int i = 1; i <= n; i++)
    if (v[i]) answer.push_back(i);
  write((int)answer.size()), putch('\n');
  for (vector<int>::iterator i = answer.begin(); i != answer.end(); i++)
    write(*i), putch(' ');
  if (!answer.empty()) putch('\n');
  for (register int i = 1; i <= k; i++)
    write(from[i]), putch(' '), write(to[i]), putch(' '), write(w[i]),
        putch('\n');
  return 0;
}