#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
template <class T>
ostream& operator<<(ostream& os, vector<T> V) {
  os << "[ ";
  for (auto v : V) os << v << " ";
  return os << "]";
}
template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
template <typename T, typename U>
pair<T, U> operator+(const pair<T, U>& l, const std::pair<T, U>& r) {
  return {l.first + r.first, l.second + r.second};
}
const long long int mod = 1e9 + 7;
const int maxn = 3005;
set<long long int> unvisited;
vector<long long int> g[500005];
vector<vector<long long int>> cmps;
void dfs(long long int u) {
  vector<long long int> temp;
  (cmps.back()).push_back(u);
  for (auto v : unvisited) {
    if (!binary_search((g[u]).begin(), (g[u]).end(), v)) {
      temp.push_back(v);
    }
  }
  for (auto v : temp) {
    unvisited.erase(v);
  }
  for (auto v : temp) {
    dfs(v);
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  for (long long int i = 1; i <= m; i++) {
    long long int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (long long int i = 1; i <= n; i++) sort((g[i]).begin(), (g[i]).end());
  for (long long int i = 1; i <= n; i++) {
    unvisited.insert(i);
  }
  long long int cnt = 0;
  for (long long int i = 1; i <= n; i++) {
    if (unvisited.count(i)) {
      unvisited.erase(i);
      cmps.emplace_back();
      dfs(i);
      cnt++;
    }
  }
  cout << cnt << " ";
  for (long long int i = 0; i < cnt; i++) {
    cout << cmps[i].size() << " ";
    for (auto v : cmps[i]) cout << v << " ";
    cout << " ";
  }
}
