#include <iostream>
#include <cstdio>
#include <map>
#include <vector>
using namespace std;
typedef pair<int,int> pii;
#define mp make_pair
#define pb push_back
int n, m;
vector<int> g[100005];
map<pii,int> done, blocked;
int processed[100005];
void print(int a, int b, int c) {
cout << a << ' ' << b << ' ' << c << '\n';
done[mp(a,b)] = done[mp(b,a)] = true;
done[mp(b,c)] = done[mp(c,b)] = true;
}
int cut(int v) {
vector<int> adj;
for(size_t i = 0; i < g[v].size(); i++) {
int u = g[v][i];
if(!blocked[mp(v,u)]) {
blocked[mp(v,u)] = blocked[mp(u,v)] = true;
adj.pb(u);
}
}
int sz = adj.size();
for(int i = 0; i < sz; i++) {
int u = adj[i];
if(!processed[u]) {
int w = cut(u);
if(w != 0) {
print(v,u,w);
}
}
}
int u = 0;
for(int i = 0; i < sz; i++) {
int curr = adj[i];
if(!done[mp(v,curr)]) {
if(u==0) {
u = curr;
} else {
print(u,v,curr);
u = 0;
}
}
}
processed[v] = true;
return u;
}
int main() {
ios_base::sync_with_stdio(false);
cin >> n >> m;
if(m%2==1) {
cout << "No solution" << endl;
return 0;
}
for(int i = 0; i < m; i++) {
int a, b; cin >> a >> b;
g[a].pb(b);
g[b].pb(a);
}
cut(1);
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0ZGlvPgojaW5jbHVkZSA8bWFwPgojaW5jbHVkZSA8dmVjdG9yPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnR5cGVkZWYgcGFpcjxpbnQsaW50PiBwaWk7CiNkZWZpbmUgbXAgbWFrZV9wYWlyCiNkZWZpbmUgcGIgcHVzaF9iYWNrCgppbnQgbiwgbTsKCnZlY3RvcjxpbnQ+IGdbMTAwMDA1XTsKCm1hcDxwaWksaW50PiBkb25lLCBibG9ja2VkOwoKaW50IHByb2Nlc3NlZFsxMDAwMDVdOwoKdm9pZCBwcmludChpbnQgYSwgaW50IGIsIGludCBjKSB7Cgljb3V0IDw8IGEgPDwgJyAnIDw8IGIgPDw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