#include <bits/stdc++.h>
using namespace std;
queue<int> q;
vector<int> gr[500020], er, ans[500020];
set<int> r;
int mark[500020];
int isval;
int f;
int x = 0;
int mm = 1;
void bfs(int v) {
  while (!q.empty()) {
    f = q.front();
    q.pop();
    for (auto i : r) {
      isval = 0;
      if (gr[f].size() == 0) {
        q.push(i);
        mark[i] = mm;
        er.push_back(i);
      } else {
        if (gr[f][lower_bound(gr[f].begin() + x, gr[f].end(), i) -
                  gr[f].begin() - x] == i) {
          isval = 1;
        }
        int x =
            lower_bound(gr[f].begin() + x, gr[f].end(), i) - gr[f].begin() - x;
        if (isval == 0) {
          q.push(i);
          mark[i] = mm;
          er.push_back(i);
        }
      }
    }
    for (int j = 0; j < er.size(); j++) {
      ans[mm].push_back(er[j]);
      r.erase(er[j]);
    }
    er.clear();
  }
  mm++;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    r.insert(i);
  }
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    gr[x].push_back(y);
    gr[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    sort(gr[i].begin(), gr[i].begin() + gr[i].size());
  }
  for (int i = 1; i <= n; i++) {
    if (mark[i] == 0) {
      mark[i] = mm;
      ans[mm].push_back(i);
      q.push(i);
      r.erase(i);
      bfs(i);
    }
  }
  cout << mm - 1 << endl;
  for (int i = 1; i < mm; i++) {
    cout << ans[i].size() << " ";
    for (int j = 0; j < ans[i].size(); j++) {
      cout << ans[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
