#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 5e5 + 10;
vector<int> cc[MAX_N];
vector<int> adj[MAX_N];
vector<int> rem;
set<int> seen;
queue<int> q;
void bfs(int u, int num) {
  q.push(u), seen.erase(u);
  cc[num].push_back(u + 1);
  while (((int)(q).size())) {
    u = q.front();
    rem.clear();
    q.pop();
    int p = 0;
    for (auto i : seen) {
      while (p < ((int)(adj[u]).size()) && adj[u][p] < i) p++;
      if (p < ((int)(adj[u]).size()) && adj[u][p] == i) continue;
      rem.push_back(i);
    }
    for (auto i : rem) {
      q.push(i), seen.erase(i);
      cc[num].push_back(i + 1);
    }
  }
}
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  while (m--) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 0; i < n; i++) {
    seen.insert(i);
    sort(adj[i].begin(), adj[i].end());
  }
  int ans = 0;
  for (int i = 0; i < n; i++)
    if (seen.count(i)) bfs(i, ans++);
  cout << ans << endl;
  for (int i = 0; i < ans; i++) {
    cout << ((int)(cc[i]).size()) << ' ';
    for (auto j : cc[i]) cout << j << ' ';
    cout << endl;
  }
  return 0;
}
