#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > rock[105];
int pos;
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    rock[i].push_back(make_pair(i, i));
  }
  pos = n + 1;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    int place = pos;
    rock[u].push_back(make_pair(u, place));
    rock[v].push_back(make_pair(v, place));
    pos++;
  }
  for (int i = 1; i <= n; i++) {
    cout << rock[i].size() << "\n";
    for (int j = 0; j < rock[i].size(); j++) {
      cout << rock[i][j].first << " " << rock[i][j].second << "\n";
    }
  }
}
