#include <bits/stdc++.h>
using namespace std;
const int N = 5000 * 100 + 5;
int n, m, cnt, c;
set<int> st, bkst;
vector<int> adj[N], ans[N];
bool flag;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) st.insert(i);
  for (int i = 1, v, u; i <= m; i++) {
    cin >> v >> u;
    adj[v].push_back(u);
    adj[u].push_back(v);
  }
  int v;
  while (!st.empty()) {
    flag = true;
    v = *st.begin();
    st.erase(v);
    ans[cnt].push_back(v);
    c = 0;
    while (c < ans[cnt].size()) {
      bkst.clear();
      v = ans[cnt][c++];
      for (auto u : adj[v])
        if (st.find(u) != st.end()) bkst.insert(u), st.erase(u);
      for (auto u : st) ans[cnt].push_back(u);
      swap(st, bkst);
    }
    cnt++;
  }
  cout << cnt << '\n';
  for (int i = 0; i < cnt; i++) {
    cout << ans[i].size() << ' ';
    for (auto j : ans[i]) cout << j << ' ';
    cout << '\n';
  }
}
