#include <bits/stdc++.h>
using namespace std;
void dfs(int s, set<int> &v, set<pair<int, int>> &edge, vector<int> &nodes) {
  v.erase(s);
  nodes.push_back(s);
  vector<int> q;
  for (auto i : v) {
    if (edge.count({min(i, s), max(i, s)}) == 0) {
      q.push_back(i);
    }
  }
  for (auto i : q) v.erase(i);
  for (auto i : q) dfs(i, v, edge, nodes);
}
void solve() {
  int n, m, ans = 0;
  cin >> n >> m;
  set<pair<int, int>> edge;
  vector<vector<int>> groups;
  vector<int> nodes;
  set<int> v;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    edge.insert({min(a, b), max(a, b)});
  }
  for (int i = 1; i <= n; i++) v.insert(i);
  for (int i = 1; i <= n; i++) {
    if (v.count(i) == 0) continue;
    ans++;
    dfs(i, v, edge, nodes);
    groups.push_back(nodes);
    nodes.clear();
  }
  cout << signed(groups.size()) << "\n";
  for (auto i : groups) {
    cout << signed(i.size()) << " ";
    for (auto x : i) cout << x << " ";
    cout << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  while (t--) solve();
  return 0;
}
