#include <bits/stdc++.h>
using namespace std;
const int maxn = 100001;
int n, m, tot, ans[maxn][3];
vector<int> rou[maxn];
bool used[maxn];
int Search(int u) {
  used[u] = 1;
  vector<int> adj;
  for (int i = 0; i < rou[u].size(); i++)
    if (!used[rou[u][i]]) adj.push_back(rou[u][i]);
  int t = 0, v, w;
  for (int i = 0; i < adj.size(); i++) {
    v = adj[i], w = Search(v);
    if (w > 0) {
      ans[tot][0] = u, ans[tot][1] = v, ans[tot++][2] = w;
    } else {
      if (t > 0) {
        ans[tot][0] = t, ans[tot][1] = u, ans[tot++][2] = v;
        t = 0;
      } else {
        t = v;
      }
    }
  }
  return t;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int u, v, i = 1; i <= m; i++) {
    scanf("%d%d", &u, &v);
    rou[u].push_back(v), rou[v].push_back(u);
  }
  if (Search(1) > 0) {
    printf("No solution\n");
  } else {
    for (int i = 0; i < tot; i++)
      printf("%d %d %d\n", ans[i][0], ans[i][1], ans[i][2]);
  }
}
