#include <bits/stdc++.h>
using namespace std;
long long t, n, m, ta, tb, k, s, minn, maxx, ans[105], sum, a[1000005],
    b[300005], c[1500005], pos[105], d1, d2, cnt, x, y, tw[65], nu, d, e, f, g,
    h = 100000000, acnt[105], pr[105][1005];
map<pair<int, int>, int> m1;
pair<int, int> p;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  for (int i = 0; i <= 100; i++) {
    c[i] = 0;
    acnt[i] = 0;
  }
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
    p.first = a[i];
    p.second = b[i];
    m1[p] = 1;
    p.first = b[i];
    p.second = a[i];
    m1[p] = 1;
    c[a[i]]++;
    c[b[i]]++;
  }
  sum = 0;
  for (int i = 1; i <= n; i++) {
    if (c[i] > 0) {
      ans[i] = 2 * c[i];
      pos[i] = sum + 1;
      for (int j = sum + 1; j <= sum + c[i]; j++) {
        pr[i][acnt[i]] = j;
        acnt[i]++;
      }
      sum = sum + c[i];
    } else {
      ans[i] = 1;
      pr[i][0] = h;
      h++;
    }
  }
  for (int i = 1; i <= n; i++) {
    p.first = i;
    for (int j = 1; j <= n; j++) {
      p.second = j;
      if (m1[p]) {
        pr[j][acnt[j]] = pos[i];
        pos[i]++;
        acnt[j]++;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (ans[i] == 1) {
      cout << 1 << '\n';
      cout << pr[i][0] << " " << pr[i][0] << '\n';
    } else {
      cout << ans[i] << '\n';
      for (int j = 0; j < ans[i]; j++) {
        cout << pr[i][j] << " " << i << '\n';
      }
    }
  }
}
