#include <bits/stdc++.h>
using namespace std;
const int N = 110;
struct Rook {
  int x, y;
};
void solveTest() {
  int n, m, u, v;
  vector<Rook> rooks[N];
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> u >> v;
    rooks[u].push_back({i, u});
    rooks[v].push_back({i, v});
  }
  for (int i = 1; i <= n; ++i) {
    rooks[i].push_back({m + i, i});
  }
  for (int i = 1; i <= n; ++i) {
    cout << rooks[i].size() << "\n";
    for (const auto &r : rooks[i]) {
      cout << r.x << " " << r.y << "\n";
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  solveTest();
  return 0;
}
