#include <bits/stdc++.h>
using namespace std;
const int N = 111;
vector<pair<int, int> > ans[N];
int a[N][N];
int main() {
  int n, m;
  cin >> n >> m;
  while (m--) {
    int x, y;
    cin >> x >> y;
    a[x][y] = 1;
    a[y][x] = 1;
  }
  for (int i = 1; i <= n; i++) {
    ans[i].push_back(make_pair(i, i));
  }
  int idx = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (a[i][j]) {
        ans[i].push_back(make_pair(n + idx, i));
        ans[j].push_back(make_pair(n + idx, j));
        idx++;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i].size() << endl;
    for (int j = 0; j < ans[i].size(); j++) {
      cout << ans[i][j].first << " " << ans[i][j].second << endl;
    }
  }
}
