#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<pair<int, int> > color[105];
bool used[105];
int main() {
  scanf("%d %d", &n, &m);
  int pos = 1;
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    if (x > y) swap(x, y);
    color[x].push_back({i, pos});
    color[y].push_back({i, pos + 1});
    used[x] = true;
    used[y] = true;
    pos += 2;
  }
  for (int i = 1; i <= n; i++) {
    auto concha = color[i];
    for (int j = 1; j < color[i].size(); j++) {
      int col = color[i][0].second;
      int fila = color[i][j].first;
      concha.push_back({fila, col});
    }
    color[i] = concha;
  }
  for (int i = 1; i <= n; i++) {
    if (!used[i]) {
      color[i].push_back({pos, pos});
      pos++;
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%d\n", color[i].size());
    for (int j = 0; j < color[i].size(); j++) {
      printf("%d %d\n", color[i][j].first, color[i][j].second);
    }
  }
  return 0;
}
