#include <bits/stdc++.h>
#pragma GCC optimize("O3")
const int inf = 0x3f3f3f3f;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long power(long long a, long long b, long long m = 1000000007) {
  long long answer = 1;
  while (b) {
    if (b & 1) answer = (answer * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return answer;
}
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int A[m][2];
  vector<pair<int, int> > v[100 + 1];
  for (int i = 0; i < n; i++) {
    v[i + 1].push_back(make_pair(i + 1, i + 1));
  }
  int j = n + 1;
  for (int i = 0; i < m; i++) {
    cin >> A[i][0] >> A[i][1];
    v[A[i][0]].push_back(make_pair(j, A[i][0]));
    v[A[i][1]].push_back(make_pair(j, A[i][1]));
    j++;
  }
  for (int i = 1; i <= n; i++) {
    cout << v[i].size() << '\n';
    for (int j = 0; j < v[i].size(); j++) {
      cout << v[i][j].first << " " << v[i][j].second << "\n";
    }
  }
  return 0;
}
