#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500100;
unordered_set<int> G[MAXN], s_;
vector<int> v;
int n, m, a, b;
void dfs(int s) {
  v.push_back(s);
  std::vector<int> cur;
  for (auto c : s_) {
    if (G[s].find(c) != G[s].end()) continue;
    cur.push_back(c);
  }
  for (auto sd : cur) s_.erase(sd);
  for (auto sd : cur) dfs(sd);
}
void Not_Stable() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) s_.insert(i);
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &a, &b);
    G[a].insert(b);
    G[b].insert(a);
  }
  int ans = 0;
  vector<int> resp;
  for (int i = 1; i <= n; i++) {
    if (s_.find(i) == s_.end()) continue;
    v.clear();
    s_.erase(i);
    dfs(i);
    ++ans;
    resp.push_back((int)v.size());
    for (auto sd : v) resp.push_back(sd);
    resp.push_back(-1);
  }
  printf("%d\n", ans);
  for (int i = 0; i < resp.size(); i++) {
    if (resp[i] == -1)
      printf("\n");
    else
      printf("%d ", resp[i]);
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  ;
  int g = 1;
  while (g--) Not_Stable();
  return 0;
}
