#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18, DELTA = 1e5;
const long double EPS = 1e-7;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<vector<long long> > set_y(n);
  vector<vector<pair<long long, long long> > > col(n);
  for (long long i = 0; i < n; ++i) {
    col[i].push_back({i + 1, -i - 1});
  }
  for (long long i = 0; i < m; ++i) {
    long long a, b;
    cin >> a >> b;
    if (a == b) {
      continue;
    }
    if (a > b) {
      swap(a, b);
    }
    set_y[b - 1].push_back(a - 1);
  }
  long long y = 1;
  for (long long i = 0; i < n; ++i) {
    for (auto x : set_y[i]) {
      col[x].push_back({x + 1, y});
      col[i].push_back({-y, y});
      col[i].push_back({i + 1, y});
      ++y;
    }
  }
  for (auto v : col) {
    cout << (signed)v.size() << "\n";
    for (auto it : v) {
      cout << it.first + DELTA << " " << it.second + DELTA << "\n";
    }
  }
  return 0;
}
