#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
vector<pair<int, int> > a[MAXN];
vector<pair<pair<int, int>, int> > ans;
bool mark[MAXN];
int id[MAXN];
int dfs(int v) {
  mark[v] = true;
  vector<pair<int, int> > adj;
  vector<int> adj2;
  for (auto u : a[v])
    if (id[u.second] == 0) {
      id[u.second] = 1;
      adj.push_back(u);
    }
  for (auto u : adj) {
    int w = dfs(u.first);
    if (w != 0) {
      ans.push_back({{w, u.first}, v});
      id[u.second] = 2;
    }
  }
  for (auto u : adj)
    if (id[u.second] == 1) adj2.push_back(u.first);
  while (adj2.size() >= 2) {
    int v1 = adj2.back();
    adj2.pop_back();
    int v2 = adj2.back();
    adj2.pop_back();
    ans.push_back({{v1, v}, v2});
  }
  if (adj2.size() == 0)
    return 0;
  else
    return adj2.back();
  return 0;
}
int main() {
  int n, m, ind = 0;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    a[x].push_back({y, ind});
    a[y].push_back({x, ind++});
  }
  int x;
  for (int i = 1; i <= n; i++)
    if (!mark[i]) {
      x = dfs(i);
      if (x != 0) {
        printf("No solution");
        return 0;
      }
    }
  for (int i = 0; i < ans.size(); i++)
    printf("%d %d %d \n", ans[i].first.first, ans[i].first.second,
           ans[i].second);
  return 0;
}
