#include <bits/stdc++.h>
using namespace std;
const long long maxn = 5e5 + 500;
vector<long long> ger[maxn];
long long moa[maxn];
long long n;
void okeyed(long long a) {
  long long savea = a;
  vector<long long> ham;
  vector<long long> ham2;
  vector<long long> tofale;
  for (long long i = 0; i < ger[a].size(); i++) {
    ham.push_back(ger[a][i]);
  }
  ham.push_back(maxn * 50);
  tofale.push_back(a);
  long long j = 0, v, u = 0;
  while (tofale.size() || j < n) {
    if (tofale.empty()) {
      while (u < ham.size() && j < n) {
        if (ham[u] == j) {
          u++;
          j++;
        } else if (ham[u] > j) {
          if (moa[j] == -1) {
            tofale.push_back(j);
            break;
          }
          j++;
        } else if (ham[u] < j) {
          u++;
        }
      }
    } else {
      long long ppu = ham[u];
      ham.pop_back();
      u = -1;
      v = tofale.back();
      tofale.pop_back();
      moa[v] = savea;
      long long p1 = 0;
      long long p2 = 0;
      while (p1 < ham.size() && p2 < ger[v].size()) {
        if (ham[p1] == ger[v][p2]) {
          if (ger[v][p2] >= ppu) {
            u = ham2.size();
            ppu = maxn * 50;
          }
          ham2.push_back(ger[v][p2]);
          p1++;
          p2++;
        } else if (ham[p1] < ger[v][p2]) {
          tofale.push_back(ham[p1]);
          p1++;
        } else {
          p2++;
        }
      }
      while (p1 < ham.size()) {
        tofale.push_back(ham[p1]);
        p1++;
      }
      if (u == -1) {
        u = ham2.size();
      }
      ham.clear();
      swap(ham, ham2);
      ham.push_back(maxn * 50);
    }
  }
}
vector<long long> ans[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  long long m, k, v, u;
  for (long long j = 0; j < maxn; j++) {
    moa[j] = -1;
  }
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    cin >> v >> u;
    ger[--u].push_back(--v);
    ger[v].push_back(u);
  }
  for (long long i = 0; i < n; i++) {
    sort(ger[i].begin(), ger[i].end());
  }
  for (long long i = 0; i < n; i++) {
    if (moa[i] == -1) {
      okeyed(i);
    }
  }
  for (long long i = 0; i < n; i++) {
    if (moa[i] < 0 || moa[i] >= maxn) {
      cout << "SALAM" << ' ' << moa[i];
      return 0;
    }
    ans[moa[i]].push_back(i);
  }
  long long ko = 0;
  for (long long i = 0; i < maxn; i++) {
    if (ans[i].size() > 0) ko++;
  }
  cout << ko << endl;
  for (long long i = 0; i < maxn; i++) {
    if (ans[i].size() > 0) {
      cout << ans[i].size() << ' ';
      for (long long j = 0; j < ans[i].size(); j++) {
        cout << ans[i][j] + 1 << ' ';
      }
      cout << endl;
    }
  }
}
