#include <bits/stdc++.h>
using namespace std;
int comps[500010];
set<int> notVis;
vector<vector<int> > adjList;
void dfs(int n, int cmp) {
  comps[n] = cmp;
  vector<int> toVis;
  int idx = 0;
  for (auto it = notVis.begin(); it != notVis.end();) {
    while (idx < adjList[n].size() && (*it) > adjList[n][idx]) idx++;
    if (idx < adjList[n].size() && (*it) == adjList[n][idx])
      idx++, it++;
    else {
      toVis.push_back((*it));
      it = notVis.erase(it);
    }
  }
  for (int i = 0; i < toVis.size(); i++) dfs(toVis[i], cmp);
}
int main() {
  ios_base::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  adjList.resize(N);
  for (int i = 0; i < M; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    adjList[x].push_back(y);
    adjList[y].push_back(x);
  }
  for (int i = 0; i < N; i++) {
    notVis.insert(i);
    sort(adjList[i].begin(), adjList[i].end());
  }
  int cmp = 1;
  while (notVis.size() != 0) {
    auto it = notVis.begin();
    int n = *it;
    notVis.erase(it);
    dfs(n, cmp);
    cmp++;
  }
  cout << cmp - 1 << endl;
  vector<vector<int> > grps(cmp - 1);
  for (int i = 0; i < N; i++) grps[comps[i] - 1].push_back(i + 1);
  for (int i = 0; i < grps.size(); i++) {
    cout << grps[i].size() << " ";
    for (int j = 0; j < grps[i].size(); j++) cout << grps[i][j] << " ";
    cout << endl;
  }
  return 0;
}
