#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
unordered_set<int> notInGraph[N];
set<int> notVis;
vector<int> cities;
void bfs(int i) {
  notVis.erase(i);
  queue<int> q;
  q.push(i);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    cities.push_back(u);
    vector<int> used;
    for (int v : notVis) {
      if (notInGraph[u].count(v)) continue;
      q.push(v);
      used.push_back(v);
    }
    for (int vertex : used) {
      notVis.erase(vertex);
    }
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  while (m--) {
    int x, y;
    cin >> x >> y;
    notInGraph[x].insert(y);
    notInGraph[y].insert(x);
  }
  for (int i = 1; i <= n; i++) {
    notVis.insert(i);
  }
  vector<vector<int>> res;
  for (int i = 1; i <= n; i++) {
    if (notVis.count(i)) {
      cities.clear();
      bfs(i);
      res.push_back(cities);
    }
  }
  cout << (int)res.size() << '\n';
  for (auto i : res) {
    cout << (int)i.size() << ' ';
    for (int j : i) {
      cout << j << ' ';
    }
    cout << '\n';
  }
  return 0;
}
