#include <bits/stdc++.h>
using namespace std;
struct edge {
  int u, v;
  edge(){};
  edge(int u, int v) : u(u), v(v){};
} e[1000100 * 2];
int qu[5 * 1000010];
int nex[5 * 1000010], pre[5 * 1000010], connect[5 * 1000010],
    start[5 * 1000010], stop[5 * 1000010];
bool fr[5 * 1000010];
vector<vector<int> > ans;
int N, M;
bool cmp(edge x, edge y) { return x.u < y.u || (x.u == y.u && x.v < y.v); }
void list_remove(int u) {
  pre[nex[u]] = pre[u];
  nex[pre[u]] = nex[u];
}
bool _find(int l, int r, int value) {
  while (l < r) {
    int mid = (l + r) >> 1;
    if (e[mid].v == value) return true;
    if (e[mid].v >= value)
      r = mid;
    else
      l = mid + 1;
  }
  return e[l].v == value;
}
void bfs(int u, vector<int> &ans) {
  list_remove(u);
  queue<int> qu;
  qu.push(u);
  fr[u] = false;
  ans.push_back(u);
  while (!qu.empty()) {
    u = qu.front();
    qu.pop();
    if (connect[u] == 0) {
      int v = nex[0];
      while (v != N + 1) {
        fr[v] = false;
        list_remove(v);
        ans.push_back(v);
        qu.push(v);
        v = nex[v];
      }
    } else {
      int v = nex[0];
      while (v != N + 1) {
        bool found = _find(start[u], stop[u], v);
        if (!found) {
          fr[v] = false;
          list_remove(v);
          ans.push_back(v);
          qu.push(v);
        }
        v = nex[v];
      }
    }
  }
}
int main() {
  scanf("%d %d", &N, &M);
  for (int i = 1; i <= M; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    e[i] = edge(u, v);
    e[i + M] = edge(v, u);
  }
  sort(e + 1, e + M * 2 + 1, cmp);
  int ii = 1;
  int jj = 2, dem = 1;
  e[M * 2 + 1].v = 0x7f7f7f7f;
  while (ii <= M * 2 && jj <= M * 2 + 1) {
    if (e[ii].u == e[jj].u)
      ++jj, ++dem;
    else {
      connect[e[ii].u] = dem;
      start[e[ii].u] = ii;
      stop[e[ii].u] = jj - 1;
      ii = jj;
      dem = 1;
    }
  }
  for (int i = 0; i <= N; ++i) nex[i] = i + 1, pre[i + 1] = i;
  memset(fr, true, sizeof(fr));
  for (int i = 1; i <= N; ++i)
    if (fr[i]) {
      ans.push_back(vector<int>());
      bfs(i, ans.back());
    }
  printf("%d", ans.size());
  for (int i = 0; i <= int(ans.size()) - 1; ++i) {
    printf("\n%d ", ans[i].size());
    for (int j = 0; j <= int(ans[i].size()) - 1; ++j) printf("%d ", ans[i][j]);
  }
  return 0;
}
