#include <bits/stdc++.h>
using namespace std;
int n, m;
int u, v;
const int N = 110;
int G[N][N];
int outd[N];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  memset(G, 0, sizeof(G));
  memset(outd, 0, sizeof(outd));
  for (int i = 0; i < m; i++)
    cin >> u >> v, G[u][v] = G[v][u] = 1, outd[u]++, outd[v]++;
  for (int i = 1; i < n + 1; i++) {
    cout << 1 + outd[i] << endl;
    cout << i << " " << (i - 1) * 100 + i << endl;
    for (int j = 1; j < n + 1; j++) {
      if (G[i][j]) {
        cout << i << " "
             << (i > j ? (j - 1) * 100 : (i - 1) * 100) + (i > j ? i : j)
             << endl;
      }
    }
  }
  return 0;
}
