#include <bits/stdc++.h>
using namespace std;
ifstream f("biconex.in");
ofstream g("biconex.out");
const int NMAX = 100005;
int n, m, x, y;
vector<vector<int>> graph;
vector<int> nivel, minim;
bitset<NMAX> used;
int timer;
stack<pair<int, int>> stiva_muchii;
vector<vector<int>> componente;
void dfs(int node, int p = 0) {
used[node] = 1;
nivel[node] = minim[node] = ++timer;
for (int next : graph[node]) {
if (next == p) continue;
if (used[next]) {
minim[node] = min(minim[node], nivel[next]);
if (nivel[next] < nivel[node]) {
stiva_muchii.push({node, next});
}
}
else {
stiva_muchii.push({node, next});
dfs(next, node);
minim[node] = min(minim[node], minim[next]);
if (minim[next] >= nivel[node]) {
vector<int> comp;
set<int> noduri_unic;
while (true) {
auto muchie = stiva_muchii.top();
stiva_muchii.pop();
noduri_unic.insert(muchie.first);
noduri_unic.insert(muchie.second);
if (muchie.first == node && muchie.second == next) {
break;
}
}
for (int nod : noduri_unic) {
comp.push_back(nod);
}
componente.push_back(comp);
}
}
}
}
int main() {
f >> n >> m;
graph.assign(n + 1, vector<int>());
nivel.assign(n + 1, 0);
minim.assign(n + 1, 0);
for (int i = 1; i <= m; i++) {
f >> x >> y;
graph[x].push_back(y);
graph[y].push_back(x);
}
for (int i = 1; i <= n; i++) {
if (!used[i]) {
dfs(i);
}
}
g << componente.size() << "\n";
for (const auto& comp : componente) {
for (int nod : comp) {
g << nod << " ";
}
g << "\n";
}
return 0;
}