#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 100;
vector<int> vv[N], tmp;
int f[N];
void fun(int x, int y) {
  int ex = vv[x].size();
  int ey = vv[y].size();
  tmp.clear();
  for (int i = 0, j = 0; i < ex; i++) {
    while (j < ey && vv[y][j] < vv[x][i]) j++;
    if (j < ey && vv[y][j] == vv[x][i]) {
      tmp.push_back(vv[x][i]);
    }
    if (j == ey) break;
  }
  int ed = tmp.size();
  vv[y].clear();
  for (int i = 0; i < ed; i++) {
    vv[y].push_back(tmp[i]);
  }
  f[x] = y;
}
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) != EOF) {
    for (int i = 1; i <= n; i++) {
      vv[i].clear();
      f[i] = i;
    }
    for (int i = 1; i <= m; i++) {
      int a, b;
      scanf("%d%d", &a, &b);
      vv[a].push_back(b);
      vv[b].push_back(a);
    }
    for (int i = 1; i <= n; i++) sort(vv[i].begin(), vv[i].end());
    for (int i = 1; i <= n; i++) {
      int k = 0;
      int ed = vv[i].size();
      for (int j = i + 1; j <= n; j++) {
        while (k < ed && vv[i][k] < j) k++;
        if (k == ed || vv[i][k] > j) {
          fun(i, j);
          break;
        }
      }
    }
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
      if (f[i] == i) cnt++;
    }
    printf("%d\n", cnt);
    for (int i = 1; i <= n; i++)
      if (f[i] == i) {
        int ed = vv[i].size();
        printf("%d", n - ed);
        int k = 0;
        for (int j = 1; j <= n; j++) {
          while (k < ed && vv[i][k] < j) k++;
          if (k == ed || vv[i][k] > j) printf(" %d", j);
        }
        printf("\n");
      }
  }
  return 0;
}
