#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 5;
vector<int> adj[MAXN];
int n, m;
int p[MAXN];
vector<int> c[MAXN];
bool is[MAXN];
int root(int v) {
  if (p[v] == -1) {
    return v;
  }
  return p[v] = root(p[v]);
}
void merg(int v, int u) {
  v = root(v);
  u = root(u);
  if (c[v].size() < c[u].size()) {
    swap(u, v);
  }
  if (u == v) {
    return;
  }
  for (int i = 0; i < c[u].size(); i++) {
    c[v].push_back(c[u][i]);
  }
  c[u].clear();
  p[u] = v;
}
void mc(int v) {
  memset(is, 0, sizeof is);
  for (int i = 0; i < adj[v].size(); i++) {
    is[adj[v][i]] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (!is[i]) {
      merg(v, i);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    p[i] = -1;
    c[i].push_back(i);
  }
  int u, v;
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    adj[v].push_back(u);
    adj[u].push_back(v);
  }
  int d;
  int mmin = 5e5 + 6;
  for (int i = 1; i <= n; i++) {
    if (adj[i].size() < mmin) {
      mmin = adj[i].size();
      d = i;
    }
  }
  mc(d);
  for (int i = 0; i < adj[d].size(); i++) {
    mc(adj[d][i]);
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    cnt += (p[i] == -1);
  }
  cout << cnt << '\n';
  for (int i = 1; i <= n; i++) {
    if (p[i] == -1) {
      cout << c[i].size() << ' ';
      for (int j = 0; j < c[i].size(); j++) {
        cout << c[i][j] << ' ';
      }
      cout << '\n';
    }
  }
}
