#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m, add = 0;
  cin >> n >> m;
  vector<vector<int>> g;
  vector<vector<pair<int, int>>> ans;
  g.resize(n);
  ans.resize(n);
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    g[x - 1].push_back(y - 1);
    g[y - 1].push_back(x - 1);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < g[i].size(); j++) {
      int to = g[i][j];
      ans[to].push_back({add, to + 1000});
      ans[i].push_back({add++, i});
    }
    ans[i].push_back({add, i});
    ans[i].push_back({add++, i + 1000});
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i].size() << endl;
    for (int j = 0; j < ans[i].size(); j++) {
      cout << ans[i][j].first + 1 << ' ' << ans[i][j].second + 1 << endl;
    }
  }
}
