#include <bits/stdc++.h>
const int MAXN = 500000;
int n, m;
std::set<std::pair<int, int>> G;
std::set<int> notVisitedYet;
std::vector<int> C[MAXN];
int component = 0;
void DFS(int node, std::set<int>::iterator& nodeIt) {
  notVisitedYet.erase(nodeIt);
  C[component].push_back(node);
  auto it = notVisitedYet.begin();
  while (it != notVisitedYet.end()) {
    int v = *it;
    if (G.find({std::min(node, v), std::max(node, v)}) == G.end()) DFS(v, it);
    it = notVisitedYet.upper_bound(v);
  }
}
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
  std::cout.tie(NULL);
  std::cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    std::cin >> u >> v;
    G.insert({std::min(u, v), std::max(u, v)});
  }
  for (int i = 1; i <= n; i++) notVisitedYet.insert(i);
  for (int i = 1; i <= n; i++) {
    std::set<int>::iterator it = notVisitedYet.find(i);
    if (it != notVisitedYet.end()) {
      DFS(i, it);
      component++;
    }
  }
  std::cout << component << '\n';
  for (int i = 0; i < component; i++) {
    std::cout << C[i].size() << ' ';
    for (int v : C[i]) std::cout << v << ' ';
    std::cout << '\n';
  }
  return 0;
}
