#include <bits/stdc++.h>
const int N = 500005;
int H[N], id;
struct Edge {
  int v, nt;
} e[N * 4];
int n, m;
int next[N];
std::vector<int> block[N];
int num, head;
int p[N];
void AddEdge(int u, int v) {
  e[id].v = v;
  e[id].nt = H[u];
  H[u] = id++;
}
int main() {
  scanf("%d%d", &n, &m);
  id = 1;
  num = 0;
  int a, b;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    AddEdge(a, b);
    AddEdge(b, a);
  }
  for (int i = 1; i <= n; i++) next[i] = i + 1;
  for (head = 1; head <= n; num++) {
    block[num].push_back(head);
    head = next[head];
    int pre;
    for (int i = 0; i < block[num].size(); i++) {
      int u = block[num][i];
      for (int j = H[u]; j; j = e[j].nt) p[e[j].v] = u;
      for (int j = head; j <= n; j = next[j])
        if (p[j] != u) {
          block[num].push_back(j);
          if (j == head)
            head = next[head];
          else
            next[pre] = next[j];
        } else
          pre = j;
    }
  }
  printf("%d\n", num);
  for (int i = 0; i < num; i++) {
    printf("%d", block[i].size());
    for (int j = 0; j < block[i].size(); j++) printf(" %d", block[i][j]);
    puts("");
  }
  return 0;
}
