#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500000 + 100;
vector<int> mp[MAXN], ans[MAXN];
int n, m, cnt = 0, f[MAXN];
int F(int x) { return f[x] != x ? f[x] = F(f[x]) : f[x]; }
void dfs(int x) {
  ans[cnt].push_back(x);
  f[x] = x + 1;
  for (int j = 0, i = F(1); i <= n; i = F(i + 1)) {
    j = lower_bound(mp[x].begin(), mp[x].end(), i) - mp[x].begin();
    if (j == mp[x].size() || mp[x][j] > i) dfs(i);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i <= n + 1; i++) {
    mp[i].clear();
    ans[i].clear();
    f[i] = i;
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    mp[x].push_back(y);
    mp[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) sort(mp[i].begin(), mp[i].end());
  for (int i = 1; i <= n; i++)
    if (f[i] == i) {
      dfs(i);
      cnt++;
    }
  cout << cnt << endl;
  for (int i = 0; i < cnt; i++) {
    cout << ans[i].size();
    for (int j = 0; j < ans[i].size(); j++) cout << " " << ans[i][j];
    cout << endl;
  }
  return 0;
}
