#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 * 1000 + 100;
int n, m;
vector<int> adj[maxn];
int cnt[maxn], sz;
bool mark[maxn];
int h[maxn], par[maxn];
vector<pair<int, pair<int, int> > > ans;
void dfs1(int v);
bool dfs2(int v);
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 0; i < n; i++) {
    if (!mark[i]) {
      dfs1(i);
      cnt[sz] /= 2;
      if (cnt[sz] % 2) {
        cout << "No solution\n";
        return 0;
      }
      sz++;
    }
  }
  if (m == 0) {
    cout << "NO solution\n";
    return 0;
  }
  fill(mark, mark + n, false);
  for (int i = 0; i < n; i++)
    if (!mark[i]) {
      par[i] = -1;
      dfs2(i);
    }
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first + 1 << " " << ans[i].second.first + 1 << " "
         << ans[i].second.second + 1 << '\n';
  return 0;
}
void dfs1(int v) {
  mark[v] = true;
  cnt[sz] += adj[v].size();
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (!mark[u]) dfs1(u);
  }
}
bool dfs2(int v) {
  mark[v] = true;
  deque<int> q;
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (!mark[u]) {
      h[u] = h[v] + 1;
      par[u] = v;
      if (!dfs2(u)) q.push_back(u);
      continue;
    }
    if (mark[u]) {
      if (h[u] > h[v]) continue;
      if (u == par[v]) continue;
      q.push_back(u);
    }
  }
  if (par[v] != -1) q.push_back(par[v]);
  while (q.size() > 1) {
    ans.push_back(pair<int, pair<int, int> >(q[0], pair<int, int>(v, q[1])));
    q.pop_front();
    q.pop_front();
  }
  if (q.size()) return false;
  return true;
}
