#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500000 + 1000;
int n, m, ans, par[MAXN];
vector<int> adj[MAXN], out[MAXN];
bool mark[MAXN];
int find(int x) {
  if (par[x] == x) return x;
  return par[x] = find(par[x]);
}
void dfs(int x) {
  mark[x] = 1;
  par[x] = x + 1;
  for (register int i = 0; i < adj[x].size(); i++) {
    int u = adj[x][i] + 1;
    while (find(u) < (i == adj[x].size() - 1 ? n : adj[x][i + 1])) {
      out[ans].push_back(find(u));
      dfs(find(u));
    }
  }
}
inline void read(register int *k) {
  register char c;
  *k = 0;
  do {
    c = getchar();
  } while (c < '0' || c > '9');
  do {
    *k = *k * 10 + c - '0';
    c = getchar();
  } while (c >= '0' && c <= '9');
}
int main() {
  read(&n);
  read(&m);
  for (register int i = 0; i < m; i++) {
    int x, y;
    read(&x);
    read(&y);
    x--;
    y--;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  for (register int i = 0; i < n; i++) adj[i].push_back(-1);
  for (register int i = 0; i < n; i++) sort(adj[i].begin(), adj[i].end());
  for (register int i = 0; i < n + 100; i++) par[i] = i;
  for (register int i = 0; i < n; i++)
    if (mark[i] == 0) {
      out[++ans].push_back(i);
      dfs(i);
    }
  cout << ans << endl;
  for (register int i = 1; i < ans + 1; i++) {
    cout << out[i].size();
    for (register int j = 0; j < out[i].size(); j++)
      cout << ' ' << out[i][j] + 1;
    cout << endl;
  }
  return 0;
}
