#include <bits/stdc++.h>
using namespace std;
const int MAX = 105;
vector<pair<int, int> > edges;
vector<pair<int, int> > res[MAX];
int main() {
  int n, m;
  while (scanf("%d %d", &n, &m) != EOF) {
    edges.clear();
    for (int i = 0; i < MAX; i++) {
      res[i].clear();
    }
    int a, b;
    while (m--) {
      scanf("%d %d", &a, &b);
      edges.push_back(pair<int, int>(a, b));
    }
    for (int i = 1; i <= n; i++) {
      res[i].push_back(pair<int, int>(i, i));
    }
    int L = n + 1;
    for (int i = 0; i < edges.size(); i++) {
      int x = edges[i].first, y = edges[i].second;
      res[x].push_back(pair<int, int>(x, L + i));
      res[y].push_back(pair<int, int>(y, L + i));
    }
    for (int i = 1; i <= n; i++) {
      printf("%d\n", res[i].size());
      for (int j = 0; j < res[i].size(); j++) {
        printf("%d %d\n", res[i][j].first, res[i][j].second);
      }
    }
  }
  return 0;
}
