#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5 * 100 * 1000 + 13;
queue<int> bfsq;
set<int> bfsS;
set<pair<int, int> > forbid;
vector<int> compV[MAXN], toDel;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int a, b;
    cin >> a >> b;
    forbid.insert(make_pair(min(a, b), max(a, b)));
  }
  for (int i = 1; i <= n; i++) bfsS.insert(i);
  int comp = 0;
  while (!bfsS.empty()) {
    comp++;
    bfsq.push(*(bfsS.begin()));
    bfsS.erase(bfsS.begin());
    while (!bfsq.empty()) {
      int u = bfsq.front();
      compV[comp].push_back(u);
      bfsq.pop();
      for (auto v : bfsS)
        if (forbid.find(make_pair(min(u, v), max(u, v))) == forbid.end()) {
          toDel.push_back(v);
          bfsq.push(v);
        }
      for (auto u : toDel) bfsS.erase(u);
      toDel.clear();
    }
  }
  cout << comp << endl;
  for (int i = 1; i <= comp; i++) {
    cout << compV[i].size() << " ";
    for (auto u : compV[i]) cout << u << " ";
    cout << endl;
  }
  return 0;
}
