#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16000000")
using namespace std;
const long long MAXN = 10000000;
long long N, M, a, b;
vector<vector<int> > G, comp;
set<int> S;
int k = 0;
void dfs(int u) {
  comp[k].push_back(u);
  for (set<int>::iterator it = S.begin(); it != S.end();) {
    int q = *it;
    if (!G[u].empty()) {
      int j = int(lower_bound(G[u].begin(), G[u].end(), q) - G[u].begin());
      if (G[u][0] <= q && G[u].back() >= q &&
          (j >= 0 && j < G[u].size() && G[u][j] == q)) {
        it++;
        continue;
      }
    }
    if (q == u) {
      it++;
      continue;
    }
    S.erase(S.find(q));
    dfs(q);
    it = S.lower_bound(q);
    if (S.empty() || it == S.end()) break;
  }
}
int order[MAXN];
int main() {
  cin >> N >> M;
  G.resize(N);
  comp.resize(N);
  for (int i = 0; i < M; i++) {
    scanf("%d%d", &a, &b);
    a--;
    b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  for (int i = 0; i < N; i++) order[i] = i;
  random_shuffle(order, order + N);
  for (int i = 0; i < N; i++) sort(G[i].begin(), G[i].end());
  for (int i = 0; i < N; i++) S.insert(i);
  for (int i = 0; i < N; i++)
    if (S.find(order[i]) != S.end()) {
      S.erase(S.find(order[i]));
      dfs(order[i]);
      k++;
    }
  cout << k << endl;
  for (int i = k - 1; i >= 0; i--) {
    cout << comp[i].size() << " ";
    for (int j = 0; j < comp[i].size(); j++) cout << comp[i][j] + 1 << " ";
    cout << endl;
  }
  return 0;
}
