#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, x, y, T, ans, big, cas, num, len;
bool flag;
vector<int> G[500005], out[500005];
set<int> st;
void bfs(int u) {
  queue<int> q;
  q.push(u);
  while (!q.empty()) {
    u = q.front();
    q.pop();
    out[ans].push_back(u);
    for (set<int>::iterator it = st.begin(); it != st.end();) {
      int v = *it;
      it++;
      if (!binary_search(G[u].begin(), G[u].end(), v)) {
        q.push(v);
        st.erase(v);
      }
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d %d", &x, &y);
    G[x].push_back(y);
    G[y].push_back(x);
  }
  for (i = 1; i <= n; i++) {
    st.insert(i);
    sort(G[i].begin(), G[i].end());
  }
  ans = 0;
  while (!st.empty()) {
    int u = *(st.begin());
    st.erase(u);
    ans++;
    bfs(u);
  }
  printf("%d\n", ans);
  for (i = 1; i <= ans; i++) {
    int size = out[i].size();
    printf("%d ", size);
    for (j = 0; j < size - 1; j++) {
      printf("%d ", out[i][j]);
    }
    printf("%d\n", out[i][size - 1]);
  }
  return 0;
}
