#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
vector<int> adj[N];
vector<pair<int, pair<long long, int> > > ans;
int lft, st[N], start;
bool mark[N];
void DFS(int v, int par) {
  mark[v] = 1;
  st[v] = start++;
  int tmp = -1;
  for (int u : adj[v]) {
    if (!mark[u]) {
      DFS(u, v);
      if (lft != -1) {
        if (tmp != -1) {
          ans.push_back({v, {lft, tmp}});
          tmp = -1;
        } else
          tmp = lft;
        lft = -1;
      }
    } else if (st[u] < st[v] && u != par) {
      if (tmp == -1)
        tmp = u;
      else {
        ans.push_back({v, {u, tmp}});
        tmp = -1;
      }
    }
  }
  if (tmp != -1) {
    if (v == par)
      lft = tmp;
    else
      ans.push_back({v, {tmp, par}});
  } else if (v != par)
    lft = v;
  return;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, m, u, v;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    adj[--u].push_back(--v);
    adj[v].push_back(u);
  }
  for (int i = 0; i < n; i++)
    if (!mark[i]) {
      lft = -1;
      DFS(i, i);
      if (lft != -1) return cout << "No solution" << endl, 0;
    }
  for (auto u : ans)
    cout << u.second.first + 1 << " " << u.first + 1 << " "
         << u.second.second + 1 << endl;
  return 0;
}
