#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> g[110];
int col[110];
vector<pair<int, int> > pcs[110];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
  int row = 1;
  int c = 0;
  for (int i = 1; i <= n; i++) {
    if (col[i] == 0) {
      col[i] = ++c;
    }
    pcs[i].push_back(make_pair(row, col[i]));
    for (int j = 0; j < (int)g[i].size(); j++) {
      int p = g[i][j];
      if (col[p] == 0) col[p] = ++c;
      pcs[p].push_back(make_pair(row, col[p]));
      if (j != 0) pcs[i].push_back(make_pair(row, col[i]));
      row++;
    }
    row++;
  }
  for (int i = 1; i <= n; i++) {
    printf("%d\n", (int)pcs[i].size());
    for (int j = 0; j < pcs[i].size(); j++)
      printf("%d %d\n", pcs[i][j].first, pcs[i][j].second);
  }
  return 0;
}
