#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
int n;
int m;
vector<int> v[100000];
int was[100000];
vector<pair<int, pair<int, int> > > res;
int go(int x, int p) {
  vector<int> u;
  was[x] = 1;
  for (int i = 0; i < ((int)(v[x]).size()); i++) {
    int y = v[x][i], z;
    if (y == p) continue;
    if (!was[y]) {
      z = go(y, x);
      if (z != -1)
        res.push_back(make_pair(z, make_pair(y, x)));
      else
        u.push_back(y);
    } else if (was[y] == 2)
      u.push_back(y);
  }
  while (((int)(u).size()) > 1) {
    int a = u.back();
    u.pop_back();
    int b = u.back();
    u.pop_back();
    res.push_back(make_pair(a, make_pair(x, b)));
  }
  was[x] = 2;
  if (u.empty()) return -1;
  return u[0];
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--;
    b--;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = 0; i < n; i++)
    if (!was[i] && go(i, i) != -1) {
      printf("No solution\n");
      return 0;
    }
  for (int i = 0; i < m / 2; i++)
    printf("%d %d %d\n", res[i].first + 1, res[i].second.first + 1,
           res[i].second.second + 1);
  return 0;
}
