#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 7;
int n, m, u, v;
set<int> q;
vector<int> ans[maxn], g[maxn];
int tot;
int cnt, del[maxn];
void solve(int u) {
  q.erase(u);
  ans[++tot].push_back(u);
  queue<int> qq;
  qq.push(u);
  while (!qq.empty()) {
    int u = qq.front();
    qq.pop();
    cnt = 0;
    for (auto &it : q) {
      int v = it;
      if (!binary_search(g[u].begin(), g[u].end(), v)) {
        ans[tot].push_back(v);
        qq.push(v);
        del[++cnt] = v;
      }
    }
    for (int i = 1; i <= cnt; i++) {
      q.erase(del[i]);
    }
  }
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    q.insert(i);
    sort(g[i].begin(), g[i].end());
  }
  for (int i = 1; i <= n; i++) {
    if (q.count(i)) {
      solve(i);
    }
  }
  printf("%d\n", tot);
  for (int i = 1; i <= tot; i++) {
    int len = ans[i].size();
    printf("%d ", len);
    for (int j = 0; j < len; j++) {
      printf("%d%c", ans[i][j], j == len - 1 ? '\n' : ' ');
    }
  }
}
