#include <bits/stdc++.h>
using namespace std;
long long int div_floor(const long long int &a, const long long int &b) {
  return a / b - (((a ^ b) < 0) and a % b);
}
long long int div_ceil(const long long int &a, const long long int &b) {
  return a / b + (((a ^ b) >= 0) and a % b);
}
vector<int> parent;
vector<int> cnt;
void make_set(int v) {
  parent[v] = v;
  cnt[v] = 1;
}
int find_set(int v) {
  if (v == parent[v]) return v;
  return parent[v] = find_set(parent[v]);
}
void union_sets(int a, int b) {
  a = find_set(a);
  b = find_set(b);
  if (a != b) {
    if (cnt[a] < cnt[b]) swap(a, b);
    parent[b] = a;
    cnt[a] += cnt[b];
  }
}
void solve() {
  int n, m;
  cin >> n >> m;
  vector<vector<int> > adj(n);
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (auto &e : adj) sort(e.begin(), e.end());
  int vertex = 0;
  for (int i = 0; i < n; i++)
    if ((long long int)adj[i].size() < (long long int)adj[vertex].size())
      vertex = i;
  vector<int> nodes = adj[vertex];
  nodes.push_back(vertex);
  sort(nodes.begin(), nodes.end());
  int n1 = (long long int)nodes.size();
  map<int, int> translate;
  for (int i = 0; i < n1; i++) translate[nodes[i]] = i;
  parent.resize(n1);
  cnt.resize(n1);
  for (int i = 0; i < n1; i++) make_set(i);
  for (int i = 0; i < n1; i++) {
    int cntr = 0;
    for (auto &v : adj[nodes[i]])
      if (!binary_search(nodes.begin(), nodes.end(), v)) cntr++;
    for (auto &v : nodes)
      if (!binary_search(adj[nodes[i]].begin(), adj[nodes[i]].end(), v))
        union_sets(i, translate[v]);
    if (cntr + n1 < n) union_sets(i, translate[vertex]);
  }
  int ans = 0;
  for (int i = 0; i < n1; i++) ans += parent[i] == i;
  cout << ans << '\n';
  vector<vector<int> > comps(n);
  for (int i = 0; i < n1; i++) comps[nodes[find_set(i)]].push_back(nodes[i]);
  for (int i = 0; i < n; i++)
    if (!binary_search(nodes.begin(), nodes.end(), i)) {
      comps[nodes[find_set(translate[vertex])]].push_back(i);
    }
  for (auto &v : comps) {
    if ((long long int)v.size() > 0) {
      cout << (long long int)v.size() << " ";
      for (auto &e : v) cout << e + 1 << " ";
      cout << '\n';
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) solve();
}
