#include <bits/stdc++.h>
using namespace std;
long long n, m;
vector<int> adj[300005];
long long x = 1;
vector<int> ans[105];
void solve() {
  for (long long i = 1; i < (n + 1); ++i) {
    if (adj[i].size()) {
      for (auto j : adj[i]) {
        ans[i].push_back(x);
        ans[j].push_back(x);
        x++;
      }
    } else
      ans[i].push_back(x), x++;
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i].size() << "\n";
    for (auto j : ans[i]) cout << j << ' ' << i << "\n";
  }
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long test = 1;
  while (test--) {
    cin >> n >> m;
    long long x, y;
    for (long long i = 0; i < (m); ++i) {
      cin >> x >> y;
      adj[x].push_back(y);
      adj[y].push_back(x);
    }
    solve();
  }
}
