#include <fstream>
#include <vector>
#include <bitset>
#include <stack>
#include <set>
std::ifstream fin("biconex.in");
std::ofstream fout("biconex.out");
int n, m, T;
int tin[100005], low[100005];
std::vector<int> L[100005];
std::bitset<100005> viz;
std::stack<std::pair<int, int>> edges;
std::vector<std::vector<int>> biconex_components;
void dfs(int k, int p) {
viz[k] = 1;
tin[k] = low[k] = ++T;
for (int w : L[k]) {
if (w == p) {
continue;
}
if (viz[w] == 1) {
low[k] = std::min(low[k], tin[w]);
if (tin[w] < tin[k]) {
edges.push(std::make_pair(k, w));
}
}
else {
edges.push(std::make_pair(k, w));
dfs(w, k);
low[k] = std::min(low[k], low[w]);
if (low[w] >= tin[k]) {
std::set<int> nodes;
std::pair<int, int> edge;
do {
edge = edges.top();
edges.pop();
nodes.insert(edge.first);
nodes.insert(edge.second);
} while (edge.first != k || edge.second != w);
biconex_components.push_back({nodes.begin(), nodes.end()});
}
}
}
}
int main() {
int x, y;
fin >> n >> m;
for (int i = 1; i <= m; i++) {
fin >> x >> y;
L[x].push_back(y);
L[y].push_back(x);
}
for (int i = 1; i <= n; i++) {
if (viz[i] == 0) {
dfs(i, -1);
}
}
fout << biconex_components.size() << "\n";
for (auto& comp : biconex_components) {
for (int node : comp) {
fout << node << " ";
}
fout << "\n";
}
}