#include <bits/stdc++.h>
using namespace std;
const int maxn = 100008;
struct Node {
  int first, second, t;
  Node(int _x = 0, int _y = 0, int _t = 0) : first(_x), second(_y), t(_t) {}
} point[maxn];
bool vis[1007];
int n, now = 0;
vector<pair<int, int> > ans[107];
vector<int> G[107];
void solve() {
  for (int i = 1; i <= n; ++i) {
    ans[i].push_back(make_pair(i, ++now));
    for (int j = 0; j < G[i].size(); ++j) {
      ans[i].push_back(make_pair(i, ++now));
      ans[G[i][j]].push_back(make_pair(G[i][j], now));
    }
  }
}
int main() {
  int m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[min(u, v)].push_back(max(u, v));
  }
  solve();
  for (int i = 1; i <= n; ++i) {
    cout << ans[i].size() << endl;
    for (int j = 0; j < ans[i].size(); ++j)
      printf("%d %d\n", ans[i][j].first, ans[i][j].second);
  }
}
