#include <bits/stdc++.h>
using namespace std;
long long n, m, x, y, c;
vector<pair<long long, long long> > a[105];
void solve() {
  cin >> n >> m;
  c++;
  while (m--) {
    cin >> x >> y;
    a[x].push_back({x, c});
    a[y].push_back({y, c});
    c++;
  }
  for (__typeof((n + 1)) i = (1); i < (n + 1); i++) {
    if (!(int)a[i].size()) a[i].push_back({i, c++});
  }
  for (__typeof((n + 1)) i = (1); i < (n + 1); i++) {
    cout << (int)a[i].size() << endl;
    for (auto j : a[i]) cout << j.first << " " << j.second << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
