#include <bits/stdc++.h>
using namespace std;
int visited[500010], n, m, mk[500010], pt[500010];
int mat[6010][6010];
vector<int> graph[500010], comp[500010], cur;
int nope = 0;
void dfs1(int s) {
  visited[s] = 1;
  cur.push_back(s);
  for (int i = 1; i <= n; i++) {
    if (i != s && !mat[s][i] && !visited[i]) {
      dfs1(i);
    }
  }
}
void dfs2(int s) {
  if (!mk[s]) {
    nope = 1;
    return;
  }
  visited[s] = 1;
  cur.push_back(s);
  for (auto to : comp[s]) {
    if (!visited[to]) {
      dfs2(to);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  vector<vector<int> > ans;
  if (n <= 6000) {
    for (int i = 0; i < m; i++) {
      int a, b;
      cin >> a >> b;
      mat[a][b] = 1;
      mat[b][a] = 1;
    }
    for (int i = 1; i <= n; i++) {
      if (!visited[i]) {
        cur.clear();
        dfs1(i);
        ans.push_back(cur);
      }
    }
  } else {
    int ansr = 0;
    for (int i = 1; i <= n; i++) {
      if (i * (n - i) > m) {
        ansr = n - (i - 1);
        break;
      }
    }
    for (int i = 0; i < m; i++) {
      int a, b;
      cin >> a >> b;
      graph[a].push_back(b);
      graph[b].push_back(a);
    }
    vector<int> spec;
    for (int i = 1; i <= n; i++) {
      if (graph[i].size() >= ansr) {
        mk[i] = 1;
        spec.push_back(i);
      }
    }
    for (int i = 0; i < spec.size(); i++) {
      vector<int> pres(n + 1);
      for (auto val : graph[spec[i]]) {
        pres[val] = 1;
      }
      for (int j = 1; j <= n; j++) {
        if (!pres[j]) {
          comp[spec[i]].push_back(j);
          comp[j].push_back(spec[i]);
        }
      }
    }
    for (int i = 0; i < spec.size(); i++) {
      if (!visited[spec[i]]) {
        cur.clear();
        nope = 0;
        dfs2(spec[i]);
        if (!nope) {
          ans.push_back(cur);
          for (auto val : cur) {
            pt[val] = 1;
          }
        }
      }
    }
    vector<int> bg;
    for (int i = 1; i <= n; i++) {
      if (!pt[i]) bg.push_back(i);
    }
    if (bg.size()) ans.push_back(bg);
  }
  cout << ans.size() << '\n';
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].size() << ' ';
    for (int j = 0; j < ans[i].size(); j++) cout << ans[i][j] << " ";
    cout << '\n';
  }
}
