#include <bits/stdc++.h>
using namespace std;
const int N = 500 * 1000 + 10;
int n, m, cnt;
set<int> sv;
vector<int> adj[N], ans[N], tmp;
queue<int> q;
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> n >> m;
  for (int i = 0, u, v; i < m; i++)
    cin >> u >> v, adj[u].push_back(v), adj[v].push_back(u);
  for (int i = 1; i <= n; i++) sv.insert(i), sort(adj[i].begin(), adj[i].end());
  while (!sv.empty()) {
    q.push(*sv.begin()), ans[++cnt].push_back(q.front()), sv.erase(sv.begin());
    while (!q.empty()) {
      int v = q.front(), bs;
      q.pop();
      for (int u : sv) {
        if (adj[v].empty())
          bs = -1;
        else
          bs =
              upper_bound(adj[v].begin(), adj[v].end(), u) - adj[v].begin() - 1;
        if ((bs ^ -1 ? adj[v][bs] : -1) ^ u) tmp.push_back(u);
      }
      for (int u : tmp) q.push(u), ans[cnt].push_back(u), sv.erase(u);
      tmp.clear();
    }
  }
  cout << cnt << '\n';
  for (int i = 1; i <= cnt; i++) {
    cout << ans[i].size() << ' ';
    for (int u : ans[i]) cout << u << ' ';
    cout << '\n';
  }
}
