#include <bits/stdc++.h>
using namespace std;
const int maxl = 5 * 1000 * 100 + 5;
vector<int> v[maxl];
int n, m;
bool flg;
set<int> deg[2];
bool marked[maxl];
int res;
vector<int> ans[maxl];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = 0; i < n; i++) deg[0].insert(i);
  for (int i = 0; i < n; i++)
    if (!marked[i]) {
      queue<int> q;
      q.push(i);
      deg[flg].erase(i);
      marked[i] = true;
      while (!q.empty()) {
        int node = q.front();
        ans[res].push_back(node);
        for (int i = 0; i < v[node].size(); i++) {
          int index = v[node][i];
          if (!marked[index]) {
            deg[flg].erase(index);
            deg[(!flg)].insert(index);
          }
        }
        for (set<int>::iterator j = deg[flg].begin(); j != deg[flg].end();
             j++) {
          marked[*j] = true;
          q.push(*j);
        }
        deg[flg].clear();
        flg = !flg;
        q.pop();
      }
      res++;
    }
  printf("%d\n", res);
  for (int i = 0; i < res; i++) {
    printf("%d", ans[i].size());
    for (int j = 0; j < ans[i].size(); j++) printf(" %d", ans[i][j] + 1);
    printf("\n");
  }
}
