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