#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
queue<int> q;
set<int> myset;
vector<int> g[N];
int n, m, cnt, c[N];
vector<int> e, C[N];
set<int>::iterator it;
bool bs(int v, int u) {
  if (g[v].size() == 0) return true;
  int up = g[v].size(), dw = 0;
  while (up - dw > 1) {
    int mid = (up + dw) / 2;
    if (g[v][mid] > u)
      up = mid;
    else
      dw = mid;
  }
  return (g[v][dw] != u);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) sort(g[i].begin(), g[i].end());
  for (int i = 1; i <= n; i++) myset.insert(i);
  while (!myset.empty()) {
    cnt++;
    c[*myset.begin()] = cnt;
    C[cnt].push_back(*myset.begin());
    q.push(*myset.begin());
    myset.erase(*myset.begin());
    while (!q.empty()) {
      int u = q.front();
      q.pop();
      for (it = myset.begin(); it != myset.end(); it++) {
        if (bs(u, *it)) {
          c[*it] = c[u];
          C[c[u]].push_back(*it);
          q.push(*it);
          e.push_back(*it);
        }
      }
      while (!e.empty()) {
        myset.erase(e.back());
        e.pop_back();
      }
    }
  }
  cout << cnt << endl;
  for (int i = 1; i <= cnt; i++) {
    cout << C[i].size() << " ";
    for (int j : C[i]) cout << j << " ";
    cout << endl;
  }
  return 0;
}
