#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
int n, m;
vector<pair<int, int> > ans[MAXN];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) ans[i].push_back(make_pair(i, i));
  int now = n;
  while (m--) {
    now++;
    int first, second;
    scanf("%d %d", &first, &second);
    ans[first].push_back(make_pair(first, now));
    ans[second].push_back(make_pair(second, now));
  }
  for (int i = 1; i <= n; i++) {
    printf("%d\n", (int)ans[i].size());
    for (auto j : ans[i]) printf("%d %d\n", j.first, j.second);
  }
  return 0;
}
