#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const double eps = 1e-6;
const int mod = (int)1e9 + 7;
const int N = 4 * (int)1e4 + 5;
const int sz = (int)1 << 19;
int cnt = 0, x, y, n, m, hm;
vector<int> comp[500500], g[500500];
bitset<500500> b;
int t[sz + sz + 100];
inline void upd(int x, int delta) {
  for (t[x += sz] = delta; x >>= 1;) t[x] = min(t[x + x], t[x + x + 1]);
}
inline int get(int l, int r) {
  int res = int(1e9);
  for (l += sz, r += sz; l <= r; l >>= 1, r >>= 1) {
    if (l & 1) res = min(res, t[l++]);
    if (!(r & 1)) res = min(res, t[r--]);
    if (l > r) break;
  }
  return res;
}
void dfs(int v) {
  upd(v, int(1e9));
  comp[cnt].push_back(v);
  for (int i = get(1, n); i != int(1e9); i = get(i + 1, n)) {
    if (binary_search(g[v].begin(), g[v].end(), i)) continue;
    dfs(i);
  }
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (int i = 1; i <= n; ++i) upd(i, i);
  for (int i = 1; i <= n; ++i) {
    sort(g[i].begin(), g[i].end());
  }
  while (get(1, n) != int(1e9)) {
    dfs(get(1, n));
    ++cnt;
  }
  cout << cnt << "\n";
  for (int i = 0; i < cnt; ++i) {
    cout << comp[i].size() << " ";
    for (int j = 0; j < comp[i].size(); ++j) {
      cout << comp[i][j] << " ";
    }
    cout << "\n";
  }
}
