#include <bits/stdc++.h>
using namespace std;
void RI() {}
template <typename... T>
void RI(int& head, T&... tail) {
  scanf("%d", &head);
  RI(tail...);
}
int n, m;
vector<int> e[100010], ord;
int dep[100010];
bool vis[100010];
void dfs(int p, int lv) {
  vis[p] = 1;
  dep[p] = lv;
  for (__typeof((e[p]).begin()) it = (e[p]).begin(); it != (e[p]).end(); it++)
    if (!vis[*it]) dfs(*it, lv + 1);
  ord.push_back(p);
}
int main() {
  RI(n, m);
  for (int i = 0; i < int(m); i++) {
    int a, b;
    RI(a, b);
    e[a].push_back(b);
    e[b].push_back(a);
  }
  if (m % 2 == 1) {
    puts("No solution");
    return 0;
  }
  dfs(1, 1);
  set<pair<int, int> > used;
  for (int ii = 0; ii < int(n); ii++) {
    int i = ord[ii];
    sort(e[i].begin(), e[i].end(),
         [&](int a, int b) { return dep[a] < dep[b]; });
    vector<int> v;
    for (__typeof((e[i]).begin()) it = (e[i]).begin(); it != (e[i]).end(); it++)
      if (!used.count(make_pair(i, *it))) v.push_back(*it);
    while (((int)(v).size()) >= 2) {
      int a = v.back();
      v.pop_back();
      int b = v.back();
      v.pop_back();
      used.insert(make_pair(a, i));
      used.insert(make_pair(i, a));
      used.insert(make_pair(b, i));
      used.insert(make_pair(i, b));
      printf("%d %d %d\n", a, i, b);
    }
  }
  return 0;
}
