#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5 * 1e5 + 1;
vector<vector<int> > G(MAXN);
set<int> st;
bool m_binary(vector<int> &v, int number) {
  int l = 0, r = v.size() - 1;
  while (l <= r) {
    const int middle = (l + r) >> 1;
    if (v[middle] == number) return true;
    if (v[middle] < number) {
      l = middle + 1;
    } else {
      r = middle - 1;
    }
  }
  return false;
}
vector<int> BFS(int &u) {
  vector<int> ret;
  queue<int> Q;
  Q.push(u);
  while (!Q.empty()) {
    int v = Q.front();
    Q.pop();
    set<int>::iterator it = st.begin();
    while (it != st.end()) {
      if (!m_binary(G[v], *it)) {
        std::set<int>::iterator current = it++;
        Q.push(*current);
        st.erase(current);
      } else {
        ++it;
      }
    }
    ret.push_back(v);
  }
  return ret;
}
int main() {
  int N, M;
  cin >> N >> M;
  int v, u;
  while (M--) {
    scanf("%d %d", &v, &u);
    G[v].push_back(u);
    G[u].push_back(v);
  }
  for (int i = 1; i <= N; i++) {
    st.insert(i);
    sort(G[i].begin(), G[i].end());
  }
  vector<vector<int> > ans;
  while (!st.empty()) {
    int now = *st.begin();
    st.erase(st.begin());
    ans.push_back(BFS(now));
  }
  printf("%d\n", ans.size());
  for (unsigned int i = 0; i < ans.size(); i++) {
    printf("%d ", ans[i].size());
    for (unsigned int j = 0; j < ans[i].size(); j++) {
      printf("%d ", ans[i][j]);
    }
    puts("");
  }
  return 0;
}
