#include <bits/stdc++.h>
using namespace std;
bool debug;
const int inf = 1e9 + 5;
const int nax = 1e6 + 5;
vector<int> w[nax];
set<int> pozostale;
vector<vector<int> > res;
int first[nax];
void zacznij(int pierwszy) {
  vector<int> kol;
  kol.push_back(pierwszy);
  for (int i = 0; i <= ((int)kol.size()) - 1; ++i) {
    pozostale.erase(kol[i]);
    for (auto b : w[kol[i]]) ++first[b];
    if (i == (int)kol.size() - 1) {
      int memo_size = (int)kol.size();
      for (auto b : pozostale)
        if (first[b] != memo_size) kol.push_back(b);
    }
  }
  res.push_back(kol);
  for (auto a : kol)
    for (auto b : w[a]) first[b] = 0;
}
int main(int argc, char *argv[]) {
  debug = argc > 1;
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) pozostale.insert(i);
  while (m--) {
    int a, b;
    scanf("%d%d", &a, &b);
    w[a].push_back(b);
    w[b].push_back(a);
  }
  for (int a = 1; a <= n; ++a)
    if (pozostale.find(a) != pozostale.end()) zacznij(a);
  printf("%d\n", (int)res.size());
  for (auto &w : res) {
    printf("%d ", (int)w.size());
    for (auto a : w) printf("%d ", a);
    puts("");
  }
  return 0;
}
