#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 5e5 + 5;
vector<int> v[N], tmp;
vector<vector<int>> ans;
set<int> st;
bool ok(int node, int x) {
  return !binary_search(v[node].begin(), v[node].end(), x);
}
void dfs(int cur) {
  tmp.push_back(cur);
  vector<int> let;
  for (int x : st) {
    if (ok(cur, x)) {
      let.push_back(x);
    }
  }
  for (int x : let) {
    st.erase(x);
  }
  for (int x : let) {
    dfs(x);
  }
}
inline void solve() {
  int n, m, l, r;
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> l >> r;
    v[l].push_back(r);
    v[r].push_back(l);
  }
  for (int i = 1; i <= n; ++i) {
    sort(v[i].begin(), v[i].end());
    st.insert(i);
  }
  while (!st.empty()) {
    int before = ((int)st.size());
    int store = *st.begin();
    st.erase(st.begin());
    dfs(store);
    int after = ((int)st.size());
    if (before - after) {
      ans.push_back(tmp);
    }
    tmp.clear();
  }
  cout << ((int)ans.size()) << '\n';
  for (vector<int> v : ans) {
    cout << ((int)v.size()) << ' ';
    for (int x : v) {
      cout << x << ' ';
    }
    cout << '\n';
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  solve();
  return 0;
}
