#include <bits/stdc++.h>
using namespace std;
const int MaxN = 100000 + 10;
int n, m, head[MaxN], nxt[MaxN << 1], to[MaxN << 1], top = 1;
void addedge(int fr, int tt) {
  top++;
  nxt[top] = head[fr];
  to[top] = tt;
  head[fr] = top;
  top++;
  nxt[top] = head[tt];
  to[top] = fr;
  head[tt] = top;
}
int block[MaxN << 1];
void init() {
  scanf("%d%d", &n, &m);
  int a, b;
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &a, &b);
    addedge(a, b);
  }
}
int block_clock;
int dfs(int x) {
  int vc = ++block_clock;
  for (int i = head[x]; i; i = nxt[i])
    if (!block[i]) block[i] = block[i ^ 1] = vc;
  vector<int> upair;
  int w, v;
  for (int i = head[x]; i; i = nxt[i])
    if (block[i] == vc) {
      w = dfs(to[i]);
      if (!w)
        upair.push_back(to[i]);
      else
        printf("%d %d %d\n", x, to[i], w);
    }
  while (upair.size() >= 2) {
    w = upair[upair.size() - 1];
    upair.pop_back();
    v = upair[upair.size() - 1];
    upair.pop_back();
    printf("%d %d %d\n", v, x, w);
  }
  if (upair.size()) return upair[0];
  return 0;
}
void solve() {
  if (m & 1) {
    printf("No solution\n");
    return;
  }
  dfs(1);
}
int main() {
  init();
  solve();
  return 0;
}
