#include <bits/stdc++.h>
using namespace std;
vector<int> graph[500005];
set<int> all;
int vis[500005];
vector<int> ans[500005];
vector<pair<int, int> > sequence;
int n, m, x, y, i, cnt, k = 0;
void graph_in() {
  scanf("%d %d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d %d", &x, &y);
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
}
void init_values() {
  for (i = 1; i <= n; i++) {
    all.insert(i);
    sort(graph[i].begin(), graph[i].end());
  }
}
void bfs(int from) {
  ans[k].push_back(from);
  queue<int> q;
  all.erase(from);
  q.push(from);
  vector<int> to_del;
  vis[from] = 1;
  int cur, l;
  while (!q.empty()) {
    cur = q.front();
    q.pop();
    for (auto &it : all) {
      if (!binary_search(graph[cur].begin(), graph[cur].end(), it)) {
        to_del.push_back(it);
        ans[k].push_back(it);
        vis[it] = 1;
        q.push(it);
      }
    }
    for (l = 0; l < to_del.size(); l++) all.erase(to_del[l]);
    to_del.clear();
  }
  k++;
}
void print_ans() {
  k = 0;
  int sz;
  while (ans[k].size()) {
    printf("%d ", ans[k].size());
    for (i = 0; i < ans[k].size(); i++) printf("%d ", ans[k][i]);
    puts("");
    k++;
  }
}
int main() {
  int h;
  graph_in();
  init_values();
  for (i = 0; i < n; i++) {
    if (!vis[i + 1]) {
      cnt++;
      bfs(i + 1);
    }
  }
  printf("%d\n", cnt);
  print_ans();
}
