#include <bits/stdc++.h>
using namespace std;
const int MX = 100005;
int n, m;
int a[MX], b[MX];
vector<int> adj[MX], con[MX];
bool vis[MX], chk[MX];
int q[MX * 2], hd, tl;
vector<int> vec;
int rem[MX], pr[MX];
void go(int i, int u) {
  int j, v;
  for (j = (int((adj[i]).size())) - 1; j >= 0; j--) {
    v = adj[i][j];
    if (vis[v]) continue;
    vis[v]++;
    con[u].push_back(v);
    q[tl++] = v, q[tl++] = i;
  }
}
void match_rem(int u) {
  int i, v;
  if (!u) return;
  for (i = (int((vec).size())) - 1; i >= 0; i--) {
    v = vec[i];
    if (a[u] == a[v] || a[u] == b[v] || b[u] == a[v] || b[u] == b[v]) {
      pr[u] = v;
      vec.erase(vec.begin() + i);
      return;
    }
  }
  vec.push_back(u);
}
void match() {
  int i, j, u;
  for (j = tl - 2; j >= 0; j -= 2) {
    u = q[j];
    vec.clear();
    for (i = (int((con[u]).size())) - 1; i >= 0; i--) {
      match_rem(rem[con[u][i]]);
    }
    if (vec.empty())
      rem[u] = u;
    else {
      pr[u] = vec[0];
      rem[u] = 0;
    }
  }
}
int main() {
  int u, v, p;
  scanf("%d%d", &n, &m);
  for (u = 1; u <= m; u++) {
    scanf("%d%d", &a[u], &b[u]);
    adj[a[u]].push_back(u);
    adj[b[u]].push_back(u);
  }
  if (m & 1) {
    puts("No solution");
    return 0;
  }
  hd = tl = 0;
  vis[1]++;
  q[tl++] = 1, q[tl++] = 0;
  while (hd < tl) {
    u = q[hd++], p = q[hd++];
    if (a[u] != p) go(a[u], u);
    if (b[u] != p) go(b[u], u);
  }
  match();
  for (u = 1; u <= m; u++) {
    v = pr[u];
    if (!v) continue;
    if (a[u] == a[v] || a[u] == b[v]) swap(a[u], b[u]);
    printf("%d %d %d\n", a[u], b[u], (b[u] == a[v]) ? b[v] : a[v]);
  }
  return 0;
}
