#include <bits/stdc++.h>
using namespace std;
char buf[1 << 21], *p1 = buf, *p2 = buf;
template <class T>
void read(T &x) {
  x = 0;
  int c = getchar();
  int flag = 0;
  while (c < '0' || c > '9') flag |= (c == '-'), c = getchar();
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  if (flag) x = -x;
}
template <class T>
T _max(T a, T b) {
  return b < a ? a : b;
}
template <class T>
T _min(T a, T b) {
  return a < b ? a : b;
}
template <class T>
bool checkmax(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <class T>
bool checkmin(T &a, T b) {
  return b < a ? a = b, 1 : 0;
}
const int N = 500005, M = 1000005;
int n, m;
int e = 0, first[N], enxt[M << 1], point[M << 1];
int pre[N], nxt[N];
int cnt = 0, vis[N], cov[N];
int q[N];
vector<int> v[N];
void add_edge(int x, int y) {
  enxt[++e] = first[x];
  first[x] = e;
  point[e] = y;
}
void remove(int x) {
  nxt[pre[x]] = nxt[x];
  pre[nxt[x]] = pre[x];
}
void init() {
  read(n);
  read(m);
  memset(first, -1, sizeof first);
  for (int i = 0; i < n; ++i) nxt[i] = i + 1;
  for (int i = 1; i <= n; ++i) pre[i] = i - 1;
  for (int i = 1, u, v; i <= m; ++i) {
    read(u);
    read(v);
    add_edge(u, v);
    add_edge(v, u);
  }
}
void bfs(int idx) {
  int head = 1, tail = 0;
  q[++tail] = idx;
  remove(idx);
  while (head <= tail) {
    int x = q[head++];
    v[cnt].push_back(x);
    for (int i = first[x]; ~i; i = enxt[i]) {
      int to = point[i];
      cov[to] = 1;
    }
    for (int t = nxt[0]; t; t = nxt[t]) {
      if (cov[t])
        cov[t] = 0;
      else {
        remove(t);
        vis[t] = 1;
        q[++tail] = t;
      }
    }
  }
}
void solve() {
  for (int i = 1; i <= n; ++i)
    if (!vis[i]) ++cnt, bfs(i);
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; ++i) {
    sort(v[i].begin(), v[i].end());
    printf("%d", (int)v[i].size());
    for (int j = 0; j < (int)v[i].size(); ++j) {
      printf(" %d", v[i][j]);
    }
    printf("\n");
  }
}
int main() {
  init();
  solve();
  return 0;
}
