#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10, M = 1e6 + 10;
vector<int> g[N];
vector<vector<int> > ans;
bool mark[N];
set<int> st;
int dfs(int v) {
  mark[v] = 1;
  int ans = 1;
  for (auto u : g[v]) {
    if (!mark[u]) ans += dfs(u);
  }
  return ans;
}
vector<int> bfs(int s) {
  queue<int> q;
  vector<int> comp;
  q.push(s);
  while (!q.empty()) {
    int v = q.front();
    comp.push_back(v);
    q.pop();
    set<int> others = st;
    for (auto u : g[v]) {
      others.erase(u);
    }
    for (auto i : others) {
      q.push(i);
      st.erase(i);
    }
  }
  return comp;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    st.insert(i);
  }
  if (dfs(1) < n) {
    cout << 1 << "\n" << n << ' ';
    for (int i = 1; i <= n; i++) cout << i << ' ';
    return 0;
  }
  while (!st.empty()) {
    int v = *(st.begin());
    st.erase(v);
    ans.push_back(bfs(v));
  }
  cout << ans.size() << "\n";
  for (auto v : ans) {
    cout << v.size() << ' ';
    for (auto i : v) cout << i << ' ';
    cout << "\n";
  }
}
