#include <bits/stdc++.h>
using namespace std;
const int MM = 5 * 100000;
const int N = 1e6;
vector<int> adj[N];
vector<int> ans[MM];
set<int> s;
int cnt, n, m;
queue<int> q;
bool mark[MM];
void bfs(int x) {
  q.push(x);
  s.erase(x);
  mark[x] = true;
  while (!q.empty()) {
    ans[cnt].push_back(q.front());
    int u = q.front();
    q.pop();
    for (int i = 0; i < adj[u].size(); i++) {
      s.erase(adj[u][i]);
    }
    for (auto i = s.begin(); i != s.end(); i++) {
      q.push(*i);
      mark[*i] = true;
    }
    s.clear();
    for (auto v : adj[u]) {
      if (!mark[v]) {
        s.insert(v);
      }
    }
  }
  cnt++;
  if (!s.empty()) bfs(*s.begin());
}
int main() {
  ios::sync_with_stdio(false);
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    s.insert(i);
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  bfs(0);
  printf("%d\n", cnt);
  for (int i = 0; i < cnt; i++) {
    printf("%d ", ans[i].size());
    for (int j = 0; j < ans[i].size(); j++) {
      printf("%d ", ans[i][j] + 1);
    }
    printf("\n");
  }
}
