#include <bits/stdc++.h>
using namespace std;
const int maxn = 500 * 1000 + 100;
const long long mod = 1e9 + 7;
const long long inf = 2 * 1e18;
long long n, m, sz;
vector<int> com[maxn];
vector<int> adj[maxn];
set<int> un_marked;
bool mark[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    sort(adj[i].begin(), adj[i].end());
    un_marked.insert(i);
  }
  for (int i = 1; i <= n; i++) {
    if (un_marked.find(i) != un_marked.end()) {
      queue<int> q;
      q.push(i);
      sz++;
      un_marked.erase(i);
      while (q.size()) {
        com[sz].push_back(q.front());
        vector<int> for_del;
        auto it = un_marked.begin();
        while (it != un_marked.end()) {
          if (!binary_search(adj[q.front()].begin(), adj[q.front()].end(),
                             *it)) {
            q.push(*it);
            for_del.push_back(*it);
          }
          it++;
        }
        for (auto x : for_del) un_marked.erase(x);
        q.pop();
      }
    }
  }
  cout << sz << endl;
  for (int i = 1; i <= sz; i++) {
    cout << com[i].size() << " ";
    for (auto x : com[i]) {
      cout << x << " ";
    }
    cout << endl;
  }
  return 0;
}
