#include <bits/stdc++.h>
using namespace std;
int n, m;
const int maxN = 5e5 + 5;
vector<int> g[maxN];
set<int> a;
vector<vector<int>> ans;
void dfs(int node) {
  a.erase(a.find(node));
  ans.back().push_back(node);
  for (int i = 0; i < g[node].size(); i++) {
    auto it = a.lower_bound(g[node][i] + 1);
    while (it != a.end()) {
      if (i == g[node].size() - 1 || *it < g[node][i + 1]) {
        dfs(*it);
        it = a.lower_bound(g[node][i] + 1);
      } else
        break;
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 0; i < n; i++) {
    a.insert(i);
    g[i].push_back(-1);
    sort(g[i].begin(), g[i].end());
  }
  for (int i = 0; i < n; i++) {
    if (a.find(i) != a.end()) {
      ans.emplace_back(vector<int>(0));
      dfs(i);
    }
  }
  cout << ans.size() << '\n';
  for (auto el : ans) {
    cout << el.size() << " ";
    for (auto v : el) {
      cout << v + 1 << " ";
    }
    cout << '\n';
  }
  return 0;
}
