#include <bits/stdc++.h>
using namespace std;
int nxt[500004];
int find(int x) { return (x == nxt[x]) ? x : nxt[x] = find(nxt[x]); }
vector<int> sol[500004];
vector<int> cur;
vector<int> adj[500004];
int n;
int sz = 0;
void dfs(int x) {
  nxt[x] = x + 1;
  sol[sz].push_back(x);
  int j = 0, omar = adj[x].size();
  for (int i = find(1); i <= n; i = find(i)) {
    while (j < omar && adj[x][j] < i) ++j;
    if (j == omar || adj[x][j] > i) dfs(i);
    ++i;
  }
}
int main() {
  ;
  int m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 1; i <= n + 1; ++i)
    nxt[i] = i, sort(adj[i].begin(), adj[i].end());
  for (int i = 1; i <= n; ++i) {
    if (nxt[i] == i) {
      dfs(i);
      ++sz;
    }
  }
  printf("%d\n", sz);
  for (int i = 0; i < sz; ++i) {
    int omar = sol[i].size();
    printf("%d ", omar);
    for (int k = 0; k < omar; ++k) printf("%d ", sol[i][k]);
    printf("\n");
  }
  return 0;
}
