#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int n, m, i, a, b, j, zz = 100000, cc;
struct po {
  int x, y;
} s[101][5001];
int c[101];
int main() {
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    s[i][c[i]].x = i;
    s[i][c[i]].y = i;
    c[i]++;
  }
  cc = n + 2;
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &a, &b);
    s[a][c[a]].x = a;
    s[a][c[a]].y = cc;
    c[a]++;
    s[b][c[b]].x = b;
    s[b][c[b]].y = cc;
    c[b]++;
    cc++;
  }
  for (i = 1; i <= n; i++) {
    printf("%d\n", c[i]);
    for (j = 0; j < c[i]; j++) printf("%d %d\n", s[i][j].x, s[i][j].y);
  }
  return 0;
}
