#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10;
set<pair<int, int>> edge;
set<pair<int, int>> v;
int cnt[MAXN];
void dfs(int &V, vector<int> &a) {
  a.push_back(V);
  vector<int> q;
  int now;
  for (auto i : v) {
    now = i.second;
    if (!edge.count({min(V, now), max(V, now)})) {
      q.push_back(now);
    }
  }
  int qs = q.size();
  for (int i = qs - 1; i >= 0; --i) v.erase({-cnt[q[i]], q[i]});
  for (int i = 0; i < qs; ++i) dfs(q[i], a);
}
int n, m, a1, a2;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> a1 >> a2;
    edge.insert({min(a1, a2), max(a1, a2)});
    ++cnt[a1];
    ++cnt[a2];
  }
  for (int i = 1; i <= n; ++i) {
    v.insert({-cnt[i], i});
  }
  vector<vector<int>> ans;
  vector<int> k;
  int p;
  while (!v.empty()) {
    ans.push_back(k);
    p = (*v.begin()).second;
    v.erase({-cnt[p], p});
    dfs(p, ans[ans.size() - 1]);
  }
  cout << ans.size() << '\n';
  for (auto i : ans) {
    cout << i.size() << " ";
    for (auto j : i) cout << j << " ";
    cout << '\n';
  }
  return 0;
}
