#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 10;
vector<int> e[N], b[N], d[N];
bool v[N], in[N];
void dfs(int root, int parent, int depth) {
  v[root] = true, in[root] = true;
  d[depth].push_back(root);
  for (auto child : e[root]) {
    if (in[child]) b[root].push_back(child);
    if (!v[child]) dfs(child, root, depth + 1);
  }
  in[root] = false;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  if (m & 1) return puts("No solution"), 0;
  for (int i = 0, x, y; i < m; ++i) {
    scanf("%d%d", &x, &y);
    e[x].push_back(y), e[y].push_back(x);
  }
  dfs(1, -1, 0);
  for (int t = n - 1, i; t >= 0; --t) {
    for (auto x : d[t]) {
      int sz = (int)b[x].size();
      for (i = sz - 1; i >= 1; i -= 2)
        printf("%d %d %d\n", b[x][i], x, b[x][i - 1]);
      if (sz & 1) b[b[x][0]].push_back(x);
    }
  }
  return 0;
}
