#include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1e9 + 7;
int64_t n, m;
vector<int64_t> adj[500001];
vector<vector<int64_t> > ans;
vector<int64_t> candi;
set<int64_t> st;
void dfs(int64_t i) {
  candi.push_back(i);
  st.erase(i);
  vector<int64_t> connect;
  for (const int64_t &j : st) {
    if (!binary_search((adj[i]).begin(), (adj[i]).end(), j)) {
      connect.push_back(j);
    }
  }
  for (const int64_t &j : connect) st.erase(j);
  for (const int64_t &j : connect) dfs(j);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int64_t i = 1; i <= m; i++) {
    int64_t a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for (int64_t i = 1; i <= n; i++) {
    st.insert(i);
    sort((adj[i]).begin(), (adj[i]).end());
  }
  for (int64_t i = 1; i <= n; i++) {
    if (st.find(i) != st.end()) {
      candi.clear();
      dfs(i);
      ans.push_back(candi);
    }
  }
  cout << ans.size() << "\n";
  for (const vector<int64_t> &v : ans) {
    cout << v.size() << " ";
    for (const int64_t &i : v) cout << i << " ";
    cout << "\n";
  }
}
