#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 1;
int n, m, a, b, par[N], d[N], o = N, k, y, anss, cnt;
vector<int> adj[N], ans[N];
bool vis[N];
int get_par(int u) {
  if (u == par[u]) return u;
  return par[u] = get_par(par[u]);
}
void add(int u, int v) {
  u = get_par(u);
  v = get_par(v);
  if (u == v) return;
  if (d[v] > d[u])
    par[u] = v;
  else
    par[v] = u;
  if (d[u] == d[v]) d[u]++;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for (int i = 1; i <= n; i++)
    if (adj[i].size() < o) {
      o = adj[i].size();
      k = i;
    }
  for (int i = 0; i < adj[k].size(); i++) vis[adj[k][i]] = 1;
  for (int i = 1; i <= n; i++) par[i] = i;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) add(k, i);
  for (int i = 0; i < adj[k].size(); i++) {
    y = adj[k][i];
    adj[y].push_back(0);
    adj[y].push_back(n + 1);
    sort(adj[y].begin(), adj[y].end());
    cnt = -1;
    for (int j = 0; j < adj[y].size() - 1; j++) {
      if (!vis[adj[y][j]]) cnt++;
      for (int l = adj[y][j] + 1; l < adj[y][j + 1]; l++)
        if (vis[l]) add(l, y);
    }
    if (cnt < n - adj[k].size()) add(y, k);
  }
  for (int i = 1; i <= n; i++) par[i] = get_par(i);
  for (int i = 1; i <= n; i++) ans[par[i]].push_back(i);
  for (int i = 1; i <= n; i++)
    if (ans[i].size() > 0) anss++;
  printf("%d\n", anss);
  for (int i = 1; i <= n; i++) {
    if (ans[i].size() > 0) {
      printf("%d ", ans[i].size());
      for (int j = 0; j < ans[i].size(); j++) printf("%d ", ans[i][j]);
      printf("\n");
    }
  }
  return 0;
}
