#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, K;
set<int> s;
set<pair<int, int> > a;
vector<int> ans[500005];
inline void dfs(int nod) {
  set<int>::iterator it;
  for (it = s.begin(); it != s.end();) {
    if (!a.count(make_pair(min(*it, nod), max(*it, nod)))) {
      int x = *it;
      s.erase(x);
      dfs(x);
      it = s.lower_bound(x);
    } else
      it++;
  }
  ans[K].push_back(nod);
}
int main() {
  ios::sync_with_stdio(false);
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d %d", &x, &y);
    if (x > y) swap(x, y);
    a.insert({x, y});
  }
  for (int i = 1; i <= n; ++i) s.insert(i);
  while (!s.empty()) {
    x = *s.begin();
    s.erase(x);
    K++;
    dfs(x);
  }
  printf("%d\n", K);
  for (int i = 1; i <= K; ++i) {
    printf("%d ", ans[i].size());
    for (auto it : ans[i]) printf("%d ", it);
    printf("\n");
  }
  return 0;
}
