#include <bits/stdc++.h>
using namespace std;
int n, m;
struct node {
  vector<int> x, y;
} a[109];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    a[u].x.push_back(u);
    a[u].y.push_back(n + i);
    a[v].x.push_back(v);
    a[v].y.push_back(n + i);
  }
  for (int i = 1; i <= n; i++) {
    a[i].x.push_back(i);
    a[i].y.push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    int tot = a[i].x.size();
    printf("%d\n", tot);
    for (int j = 0; j < tot; j++) printf("%d %d\n", a[i].x[j], a[i].y[j]);
  }
  return 0;
}
