#include <bits/stdc++.h>
using namespace std;
const int N = 500005, M = 1e6 + 5;
int g[N];
vector<int> a[N], ans[N];
int FIND(int x) { return g[x] == x ? x : g[x] = FIND(g[x]); }
void UNION(int x, int y) { g[FIND(x)] = FIND(y); }
int main(void) {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) g[i] = i;
  while (m--) {
    int x, y;
    scanf("%d%d", &x, &y);
    a[x].push_back(y);
    a[y].push_back(x);
  }
  int mindeg = n, mdi = 0;
  for (int i = 1; i <= n; i++)
    if (((int)(a[i]).size()) < mindeg) {
      mindeg = ((int)(a[i]).size());
      mdi = i;
    }
  sort(a[mdi].begin(), a[mdi].end());
  for (int i = 1, j = 0; i <= n; i++) {
    if (j < ((int)(a[mdi]).size()) && a[mdi][j] == i)
      ++j;
    else
      UNION(mdi, i);
  }
  for (__typeof((a[mdi]).begin()) it = (a[mdi]).begin(); it != (a[mdi]).end();
       it++)
    sort(a[*it].begin(), a[*it].end());
  for (__typeof((a[mdi]).begin()) it = (a[mdi]).begin(); it != (a[mdi]).end();
       it++) {
    for (int i = 1, j = 0; i <= n; i++) {
      if (j < ((int)(a[*it]).size()) && a[*it][j] == i)
        ++j;
      else
        UNION(*it, i);
    }
  }
  for (int i = 1; i <= n; i++) ans[FIND(i)].push_back(i);
  int sans = 0;
  for (int i = 1; i <= n; i++)
    if (g[i] == i) ++sans;
  printf("%d\n", sans);
  for (int i = 1; i <= n; i++)
    if (((int)(ans[i]).size())) {
      printf("%d", ((int)(ans[i]).size()));
      for (__typeof((ans[i]).begin()) it = (ans[i]).begin();
           it != (ans[i]).end(); it++)
        printf(" %d", *it);
      puts("");
    }
  return 0;
}
