#include <bits/stdc++.h>
using namespace std;
const int N = 2000 * 1000 + 2;
int n, m, x, y, cnt = 0, par[N], sum, s[N], deg[N], mo[N];
vector<int> adj[N], A, B, ans[N];
bool vis[N], is[N];
int get_par(int v) {
  if (par[v] == v) return v;
  return par[v] = get_par(par[v]);
}
void add(int u, int v) {
  u = get_par(u);
  v = get_par(v);
  if (u == v) return;
  if (s[u] < s[v]) swap(u, v);
  par[v] = u;
  s[u] += s[v];
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    adj[x].push_back(y);
    adj[y].push_back(x);
    deg[x]++;
    deg[y]++;
  }
  int u = min_element(deg + 1, deg + n + 1) - deg;
  for (int i = 0; i < (int((adj[u]).size())); i++) {
    vis[adj[u][i]] = true;
    A.push_back(adj[u][i]);
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i]) B.push_back(i);
  for (int i = 1; i <= n; i++) s[i] = 1;
  s[u] = (int((B).size()));
  for (int i = 1; i <= n; i++) par[i] = (vis[i]) ? i : u;
  for (int i = 0; i < (int((A).size())); i++) {
    int v = A[i];
    for (int j = 0; j < (int((adj[v]).size())); j++) is[adj[v][j]] = true;
    for (int j = 0; j < (int((A).size())); j++)
      if (!is[A[j]]) add(v, A[j]);
    for (int j = 0; j < (int((adj[v]).size())); j++) is[adj[v][j]] = false;
  }
  for (int i = 0; i < (int((A).size())); i++) {
    int v = A[i];
    for (int j = 0; j < (int((adj[v]).size())); j++) is[adj[v][j]] = true;
    for (int j = 0; j < (int((B).size())); j++)
      if (!is[B[j]]) add(v, B[j]);
    for (int j = 0; j < (int((adj[v]).size())); j++) is[adj[v][j]] = false;
  }
  for (int i = 1; i <= n; i++) {
    int k = get_par(i);
    if (mo[k] == 0) mo[k] = ++cnt;
    ans[mo[k]].push_back(i);
  }
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; i++) {
    printf("%d ", (int((ans[i]).size())));
    for (int j = 0; j < (int((ans[i]).size())); j++) printf("%d ", ans[i][j]);
    printf("\n");
  }
  return 0;
}
