#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v[100010];
vector<pair<int, pair<int, int> > > ans;
bool mark[100010] = {0};
bool mark1[100010] = {0};
int dfs(int cur) {
  mark[cur] = 1;
  int val = -1, i;
  for (i = 0; i < v[cur].size(); ++i) {
    int j = v[cur][i].first;
    if (!mark[j]) {
      mark1[v[cur][i].second] = 1;
      int num = dfs(j);
      if (num == -1) {
        if (val == -1)
          val = j;
        else {
          ans.push_back(make_pair(val, make_pair(cur, j)));
          val = -1;
        }
      } else
        ans.push_back(make_pair(num, make_pair(j, cur)));
    } else if (!mark1[v[cur][i].second]) {
      mark1[v[cur][i].second] = 1;
      if (val == -1)
        val = j;
      else {
        ans.push_back(make_pair(val, make_pair(cur, j)));
        val = -1;
      }
    }
  }
  return val;
}
int main() {
  int n, m, i, x, y;
  scanf("%d", &n);
  scanf("%d", &m);
  for (i = 0; i < m; ++i) {
    scanf("%d", &x);
    scanf("%d", &y);
    v[x].push_back(make_pair(y, i));
    v[y].push_back(make_pair(x, i));
  }
  if (dfs(1) == -1) {
    for (i = 0; i < ans.size(); ++i)
      printf("%d %d %d\n", ans[i].first, ans[i].second.first,
             ans[i].second.second);
  } else
    printf("No solution\n");
}
