#include <bits/stdc++.h>
int n, m;
bool tab[105][105];
int last[105];
std::vector<std::pair<int, int> > pos[105];
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  std::cin >> n >> m;
  for (int i = 0; i < (m); ++i) {
    int a, b;
    std::cin >> a >> b;
    b--;
    a--;
    tab[b][a] = true;
    tab[a][b] = true;
  }
  for (int i = 0; i < (105); ++i) last[i] = -1;
  int cur_x = 1;
  int cur_y = 1;
  int cur_yfree = 2;
  for (int i = 0; i < (n); ++i) {
    if (last[i] != -1) pos[i].push_back(std::make_pair(cur_x, last[i]));
    pos[i].push_back(std::make_pair(cur_x, cur_y));
    cur_x++;
    last[i] = cur_y;
    for (int j = (i + 1); j < (n); ++j) {
      if (tab[i][j]) {
        pos[i].push_back(std::make_pair(cur_x, cur_y));
        last[i] = cur_y;
        if (last[j] != -1) pos[j].push_back(std::make_pair(cur_x, last[j]));
        pos[j].push_back(std::make_pair(cur_x, cur_yfree));
        last[j] = cur_yfree;
        cur_yfree++;
        cur_x++;
      }
    }
    cur_y = cur_yfree;
    cur_yfree++;
  }
  for (int i = 0; i < (n); ++i) {
    std::cout << ((int)(pos[i]).size()) << "\n";
    for (auto &j : pos[i]) std::cout << j.first << " " << j.second << "\n";
  }
  return 0;
}
