#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
int n, m, comps;
set<pair<int, int> > roads;
set<int> nods, components[N];
set<int>::iterator it;
bool not_exist(int v, int u) {
  if (v > u) swap(v, u);
  if (roads.find({v, u}) == roads.end())
    return true;
  else
    return false;
}
void dfs(int v) {
  vector<int> tmp;
  for (auto i : nods)
    if (not_exist(v, i)) tmp.push_back(i);
  for (auto i : tmp) nods.erase(i);
  for (auto i : tmp) dfs(i);
  components[comps].insert(v);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) nods.insert(i);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    if (u > v) swap(u, v);
    roads.insert({u, v});
  }
  for (int i = 1; i <= n; i++)
    if (nods.find(i) != nods.end()) {
      dfs(i);
      comps++;
    }
  printf("%d\n", comps);
  for (int i = 0; i < comps; i++) {
    printf("%d", components[i].size());
    for (auto j : components[i]) printf(" %d", j);
    printf("\n");
  }
  return 0;
}
