#include <bits/stdc++.h>
using namespace std;
set<int> ver;
int vis[500100], sz[500100], c;
vector<int> comp[500100], g[500100];
void dfs(int u, int p) {
  comp[c].push_back(u);
  sz[c]++;
  for (int i = 0; i < g[u].size(); i++) vis[g[u][i]] = 1;
  vector<int> t;
  for (set<int>::iterator it = ver.begin(); it != ver.end(); it++) {
    if (!vis[*it]) {
      t.push_back(*it);
    }
  }
  for (int i = 0; i < g[u].size(); i++) vis[g[u][i]] = 0;
  for (int i = 0; i < t.size(); i++) ver.erase(t[i]);
  for (int i = 0; i < t.size(); i++) dfs(t[i], u);
}
int main() {
  ios::sync_with_stdio(0);
  int n, m, i, u, j, v;
  scanf("%d %d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d %d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (i = 1; i <= n; i++) ver.insert(i);
  for (i = 1; i <= n; i++) {
    if (ver.find(i) == ver.end()) continue;
    ver.erase(i);
    c++;
    dfs(i, 0);
  }
  printf("%d\n", c);
  for (i = 1; i <= c; i++) {
    printf("%d ", sz[i]);
    for (j = 0; j < sz[i]; j++) printf("%d ", comp[i][j]);
    printf("\n");
  }
}
