#include <bits/stdc++.h>
using namespace std;
set<int> s;
set<pair<int, int> > m;
vector<int> ans[500005];
void dfs(int i, int c) {
  s.erase(i);
  ans[c].push_back(i);
  auto it = s.begin();
  while (it != s.end()) {
    int y = *it;
    if (m.find(make_pair(min(i, y), max(i, y))) == m.end()) dfs(y, c);
    it = s.upper_bound(y);
  }
}
int main() {
  int n, e, a, b;
  scanf("%d%d", &n, &e);
  for (int i = 1; i <= n; i++) s.insert(i);
  for (int i = 0; i < e; i++) {
    scanf("%d%d", &a, &b);
    m.insert(make_pair(min(a, b), max(a, b)));
  }
  int c = 0;
  for (int i = 1; i <= n; i++) {
    if (s.find(i) != s.end()) dfs(i, c++);
  }
  printf("%d\n", c);
  for (int i = 0; i < c; i++) {
    printf("%d ", ans[i].size());
    for (int j = 0; j < ans[i].size(); j++) printf("%d ", ans[i][j]);
    printf("\n");
  }
}
