#include <bits/stdc++.h>
using namespace std;
const int maxn = 5 * 100 * 1000 + 1000;
vector<int> v[maxn];
vector<int> group[maxn];
int _next[maxn];
bool mark[maxn];
int n;
int find_next(int x) {
  if (_next[x] == x) return x;
  return _next[x] = find_next(_next[x]);
}
void dfs(int x, int cnt) {
  group[cnt].push_back(x);
  mark[x] = true;
  _next[x] = x + 1;
  for (int i = find_next(1), j = 0; i <= n; i = find_next(i + 1)) {
    while (j < v[x].size() && v[x][j] < i) j++;
    if (j == v[x].size() || i != v[x][j]) dfs(i, cnt);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int m;
  cin >> n >> m;
  while (m--) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = 0; i <= n; i++) sort(v[i].begin(), v[i].end());
  for (int i = 1; i <= n + 1; i++) _next[i] = i;
  int cnt = 0;
  for (int i = find_next(1); i <= n; i = find_next(i))
    if (mark[i] == false) dfs(i, cnt), cnt++;
  cout << cnt << endl;
  for (int i = 0; i < cnt; i++) {
    cout << group[i].size() << " ";
    for (int j = 0; j < group[i].size(); j++) cout << group[i][j] << " ";
    cout << endl;
  }
  return 0;
}
