#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 9;
int N, M;
int cur[maxn];
vector<int> g[maxn], pos[maxn];
int main() {
  cin >> N >> M;
  while (M--) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].emplace_back(v);
    g[v].emplace_back(u);
  }
  M = 0;
  for (int i = 1; i <= N; i++) {
    int sz = max(1, (int)g[i].size());
    while (sz--) pos[i].emplace_back(++M);
  }
  for (int i = 1; i <= N; i++)
    for (auto e : g[i])
      if (e > i) pos[i].emplace_back(pos[e][cur[e]++]);
  for (int i = 1; i <= N; i++) {
    printf("%d\n", (int)pos[i].size());
    for (auto e : pos[i]) printf("%d %d\n", i, e);
  }
  return 0;
}
