#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > adj_lis;
map<pair<int, int>, int> dis;
struct ans {
  int p, q, r;
};
vector<ans> val;
int dfs(int p) {
  vector<int> adjacent;
  for (vector<int>::iterator it = (adj_lis[p]).begin();
       it != (adj_lis[p]).end(); it++) {
    if (dis.count(pair<int, int>(p, *it)) == 1) {
      adjacent.push_back(*it);
      dis.erase(dis.find(pair<int, int>(p, *it)));
      dis.erase(dis.find(pair<int, int>(*it, p)));
    }
  }
  vector<int> unp;
  for (vector<int>::iterator it = (adjacent).begin(); it != (adjacent).end();
       it++) {
    int w = dfs(*it);
    if (w == 0)
      unp.push_back(*it);
    else {
      ans k;
      k.p = p;
      k.q = *it;
      k.r = w;
      val.push_back(k);
    }
  }
  while (unp.size() >= 2) {
    int r = unp.back();
    unp.pop_back();
    int p1 = unp.back();
    unp.pop_back();
    ans k;
    k.p = p1;
    k.q = p;
    k.r = r;
    val.push_back(k);
  }
  if (unp.empty()) {
    return 0;
  }
  return unp.back();
}
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  adj_lis.resize(n + 1);
  for (int i = int(0); i <= int(m - 1); i++) {
    int p, q;
    scanf("%d", &p);
    scanf("%d", &q);
    adj_lis[p].push_back(q);
    adj_lis[q].push_back(p);
    dis[pair<int, int>(p, q)] = 0;
    dis[pair<int, int>(q, p)] = 0;
  }
  int q = dfs(1);
  if (q == 0) {
    int sz = val.size();
    for (int i = int(0); i <= int(sz - 1); i++) {
      printf("%d %d %d\n", val[i].p, val[i].q, val[i].r);
    }
  } else
    cout << "No solution\n";
  return 0;
}
