#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
long long int t, n, m;
set<long long int> vis;
queue<long long int> q;
vector<long long int> temp, v[500005], g[500005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int i, j, k, x, y;
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (i = 1; i <= n; i++) {
    sort(g[i].begin(), g[i].end());
    vis.insert(i);
  }
  long long int comp = 0;
  for (i = 1; i <= n; i++) {
    if (vis.find(i) == vis.end())
      continue;
    else
      x = i;
    vis.erase(x);
    q.push(x);
    comp++;
    while (!q.empty()) {
      x = q.front();
      q.pop();
      v[comp].push_back(x);
      temp.clear();
      for (auto it : vis) {
        if (!binary_search(g[x].begin(), g[x].end(), it)) {
          temp.push_back(it);
          q.push(it);
        }
      }
      for (auto it : temp) vis.erase(it);
    }
  }
  cout << comp << '\n';
  for (i = 1; i <= comp; i++) {
    cout << v[i].size() << " ";
    for (auto it : v[i]) cout << it << " ";
    cout << '\n';
  }
  return 0;
}
