#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
int n, m, cnt, belong[N];
vector<int> g[N], ans[N];
int get(int x) { return belong[x] ? belong[x] = get(belong[x]) : x; }
void dfs(int i) {
  ans[cnt].push_back(i);
  belong[i] = i + 1;
  for (int j = get(1), k = 0; j <= n; j = get(j + 1)) {
    for (; k < g[i].size() && g[i][k] < j; k++)
      ;
    if (k < g[i].size() && g[i][k] == j) continue;
    dfs(j);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  while (m--) {
    int a, b;
    scanf("%d%d", &a, &b);
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) sort(g[i].begin(), g[i].end());
  for (int i = 1; i <= n; i++)
    if (!belong[i]) {
      dfs(i);
      cnt++;
    }
  printf("%d\n", cnt);
  for (int i = 0; i < cnt; i++) {
    printf("%u", ans[i].size());
    for (int j = 0; j < ans[i].size(); j++) printf(" %d", ans[i][j]);
    puts("");
  }
}
