#include <bits/stdc++.h>
const int N = 500010;
const int inf = 0x3f3f3f3f;
using namespace std;
int n, m;
int vis[N];
bool q[N];
set<int> st;
int l[N];
vector<int> vt[N], ret[N];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    vt[a].push_back(b);
    vt[b].push_back(a);
  }
  int tot = 0;
  for (int i = 1; i <= n; i++) l[i - 1] = i;
  l[n] = -1;
  while (l[0] + 1) {
    tot++;
    int u = l[0];
    queue<int> que;
    que.push(u);
    ret[tot].push_back(u);
    l[0] = l[u];
    while (!que.empty()) {
      int v = que.front();
      que.pop();
      int sz = vt[v].size();
      for (int i = 0; i < sz; i++) vis[vt[v][i]] = v;
      for (int pre = 0, i = l[0]; i + 1; pre = i, i = l[i]) {
        if (vis[i] == v) continue;
        que.push(i);
        ret[tot].push_back(i);
        i = pre;
        l[i] = l[l[i]];
      }
    }
  }
  printf("%d\n", tot);
  for (int i = 1; i <= tot; i++) {
    sort(ret[i].begin(), ret[i].end());
    int sz = ret[i].size();
    printf("%d", sz);
    for (int j = 0; j < sz; j++) printf(" %d", ret[i][j]);
    puts("");
  }
  return 0;
}
