#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 10, M = 1e6 + 100, MOD = 1e9 + 7, ML = 25;
int a[M], ne[M];
map<int, bool> mp[M];
vector<int> ve[M], adj[M];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    adj[i].push_back(INF);
    sort(adj[i].begin(), adj[i].end());
    ne[i] = i + 1;
  }
  ne[n] = -1;
  int l = 0, r = 0, cnt = 0, link = 1;
  while (link != -1) {
    int la = r;
    a[r++] = link;
    link = ne[link];
    while (l < r) {
      int v = a[l++];
      ve[cnt].push_back(v);
      int u = link, la = -1;
      while (u != -1) {
        int z = *lower_bound(adj[v].begin(), adj[v].end(), u);
        if (z != u) {
          if (u == link) link = ne[link];
          if (la != -1) ne[la] = ne[u];
          a[r++] = u;
        } else
          la = u;
        u = ne[u];
      }
    }
    cnt++;
  }
  printf("%d\n", cnt);
  for (int i = 0; i < cnt; i++) {
    printf("%d ", ve[i].size());
    for (int u : ve[i]) printf("%d ", u);
    printf("\n");
  }
}
