#include <bits/stdc++.h>
using namespace std;
long long int n, m;
vector<long long int> a[500005];
set<long long int> vis;
vector<vector<long long int> > ans;
vector<long long int> vv;
inline void dfs(long long int node) {
  vis.erase(node);
  vv.push_back(node);
  long long int cur = 0;
  while (!vis.empty()) {
    auto it = vis.upper_bound(cur);
    if (it == vis.end()) break;
    long long int tmp = (*it);
    if (!binary_search((a[node]).begin(), (a[node]).end(), tmp)) {
      dfs(tmp);
    }
    cur = (tmp);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int i, j;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    long long int u, v;
    cin >> u >> v;
    a[u].push_back(v);
    a[v].push_back(u);
  }
  for (i = 1; i <= n; i++) {
    vis.insert(i);
    sort((a[i]).begin(), (a[i]).end());
  }
  long long int cnt = 0;
  for (i = 1; i <= n; i++) {
    if (vis.find(i) != vis.end()) {
      cnt++;
      vv.clear();
      dfs(i);
      ans.push_back(vv);
    }
  }
  cout << cnt << "\n";
  for (auto it : ans) {
    cout << (long long int)(it.size()) << " ";
    for (auto iit : it) cout << iit << " ";
    cout << "\n";
  }
  return 0;
}
