#include <bits/stdc++.h>
using namespace std;
const int MAX = 500005;
int n, m;
vector<int> adj[MAX];
vector<int> g[MAX];
int f[MAX];
int cnt;
int find(int u) { return f[u] = (f[u] == u) ? u : find(f[u]); }
void dfs(int u) {
  f[u] = u + 1;
  g[cnt].push_back(u);
  for (int i = find(1), j = 0; i <= n; i = find(i + 1)) {
    for (; j < (int)adj[u].size() && adj[u][j] < i; ++j)
      ;
    if (j == (int)adj[u].size() || adj[u][j] != i) dfs(i);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  int u, v;
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 1; i <= n + 1; ++i) {
    f[i] = i;
    sort(adj[i].begin(), adj[i].end());
  }
  for (int i = 1; i <= n; ++i)
    if (f[i] == i) {
      ++cnt;
      dfs(i);
    }
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; ++i)
    if (g[i].size()) {
      printf("%d", (int)g[i].size());
      for (int j = 0; j < (int)g[i].size(); ++j) printf(" %d", g[i][j]);
      printf("\n");
    }
  return 0;
}
