#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const long long LNF = 1e18;
void setIO(string s) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}
const int N = 5e5 + 7;
set<int> unvis;
vector<int> adj[N];
vector<vector<int> > ans;
void dfs(int u) {
  ans.back().emplace_back(u);
  for (auto it = unvis.begin(); it != unvis.end();) {
    if (!binary_search(begin(adj[u]), end(adj[u]), *it)) {
      int x = *it;
      unvis.erase(it);
      dfs(x);
      it = unvis.upper_bound(x);
    } else
      ++it;
  }
}
int main() {
  setIO("input");
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    adj[u].emplace_back(v), adj[v].emplace_back(u);
  }
  for (int i = 0; i < n; ++i)
    unvis.emplace(i), sort(begin(adj[i]), end(adj[i]));
  while (!unvis.empty()) {
    ans.emplace_back();
    int u = *unvis.begin();
    unvis.erase(unvis.begin());
    dfs(u);
  }
  cout << (int)ans.size() << '\n';
  for (auto& i : ans) {
    cout << (int)i.size() << '\n';
    for (auto& j : i) cout << j + 1 << ' ';
    cout << '\n';
  }
}
