#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m;
  cin >> n;
  cin >> m;
  vector<pair<long long, long long>> a;
  for (long long i = 0; i < m; ++i) {
    long long c1, c2;
    cin >> c1;
    cin >> c2;
    a.push_back(make_pair(c1, c2));
  }
  map<long long, vector<pair<long long, long long>>> res;
  for (long long i = 0; i < n; ++i) {
    long long c = i + 1;
    long long cx = i + 1;
    long long cy = i + 1;
    res[c].push_back(make_pair(cx, cy));
  }
  long long cx = n;
  for (long long i = 0; i < m; ++i) {
    cx += 1;
    long long c1 = a[i].first;
    long long c2 = a[i].second;
    res[c1].push_back(make_pair(cx, c1));
    res[c2].push_back(make_pair(cx, c2));
  }
  for (long long i = 0; i < n; ++i) {
    long long c = i + 1;
    cout << res[c].size() << "\n";
    for (auto e : res[c]) {
      cout << e.first << " " << e.second << "\n";
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << setprecision(numeric_limits<long double>::digits10 + 1);
  int n = 1;
  for (long long i = 0; i < n; ++i) {
    solve();
  }
  return 0;
}
