#include <bits/stdc++.h>
using namespace std;
long long n, m;
unordered_set<long long> e;
set<long long> s;
vector<vector<long long>> ans;
queue<long long> q;
void bfs(long long node) {
  s.erase(node);
  q.push(node);
  vector<long long> visited;
  while (!q.empty()) {
    node = q.front();
    visited.push_back(node);
    q.pop();
    vector<long long> to_erase;
    for (auto it = s.begin(); it != s.end(); it++) {
      if (e.count(n * node + *it)) continue;
      to_erase.push_back(*it);
    }
    for (auto x : to_erase) s.erase(x), q.push(x);
  }
  ans.push_back(visited);
}
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) s.insert(i);
  for (long long i = 1; i <= m; i++) {
    long long a, b;
    cin >> a >> b;
    e.insert(n * a + b);
    e.insert(n * b + a);
  }
  for (long long i = 1; i <= n; i++) {
    if (!s.count(i)) continue;
    bfs(i);
  }
  cout << ans.size() << '\n';
  for (auto x : ans) {
    cout << x.size() << ' ';
    for (auto y : x) cout << y << " ";
    cout << '\n';
  }
}
