#include <bits/stdc++.h>
using namespace std;
long long int const inf = 1e18;
long long int const maxn = 1e6 + 5;
long long int const mod = 1e9 + 7;
set<int> unvisited;
vector<pair<int, int>> v;
int cur = 0;
vector<int> components[maxn];
pair<int, int> fx(int x, int y) { return make_pair(min(x, y), max(x, y)); }
void dfs(int i) {
  components[cur].push_back(i);
  for (auto it = unvisited.begin(); it != unvisited.end();) {
    if (!binary_search(v.begin(), v.end(), fx(i, *it))) {
      int val = *it;
      unvisited.erase(it);
      dfs(val);
      it = unvisited.upper_bound(val);
    } else
      it++;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    v.push_back(fx(x, y));
  }
  sort(v.begin(), v.end());
  for (int i = 1; i <= n; i++) unvisited.insert(i);
  while (!unvisited.empty()) {
    int v = *unvisited.begin();
    unvisited.erase(unvisited.begin());
    dfs(v);
    cur++;
  }
  cout << cur << "\n";
  ;
  for (int i = 0; i < cur; i++) {
    int sz = components[i].size();
    cout << sz << " ";
    for (auto u : components[i]) cout << u << " ";
    cout << "\n";
    ;
  }
  return 0;
}
