#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
unordered_set<int> adj[maxn];
unordered_set<int> unvis;
vector<int> c[maxn];
int ctr = 0;
void dfs(int u) {
  c[ctr].push_back(u);
  vector<int> tovisit;
  for (int x : unvis) {
    if (adj[u].count(x) == 0) {
      tovisit.push_back(x);
    }
  }
  for (int x : tovisit) {
    unvis.erase(x);
  }
  for (int x : tovisit) {
    dfs(x);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].insert(v);
    adj[v].insert(u);
  }
  for (int i = 1; i <= n; i++) {
    unvis.insert(i);
  }
  while (unvis.size()) {
    int cur = *unvis.begin();
    unvis.erase(unvis.begin());
    dfs(cur);
    ctr++;
  }
  cout << ctr << '\n';
  for (int i = 0; i < ctr; i++) {
    cout << c[i].size() << " ";
    for (int x : c[i]) cout << x << " ";
    cout << '\n';
  }
  return 0;
}
