#include <bits/stdc++.h>
template <class C, class E>
inline bool contains(const C& container, const E& element) {
  return container.find(element) != container.end();
}
template <class T>
inline void checkmin(T& a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T& a, T b) {
  if (b > a) a = b;
}
using namespace std;
int n, m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << std::setprecision(15);
  cout << std::fixed;
  cin >> n;
  cin >> m;
  map<int, set<int>> rel;
  vector<pair<int, int>> ha(m);
  int blockSize = n;
  for (int i = (0), _b = ((m)-1); i <= _b; i++) {
    cin >> ha[i].first >> ha[i].second;
    --ha[i].first;
    --ha[i].second;
    rel[ha[i].first].insert(ha[i].second);
    rel[ha[i].second].insert(ha[i].first);
  }
  int xPos = 1;
  vector<int> nextPos(n);
  for (int i = (0), _b = ((n)-1); i <= _b; i++) {
    nextPos[i] = xPos;
    int s = rel[i].size();
    checkmax(s, 1);
    xPos += s;
  }
  int xStart = 1;
  for (int y = (0), _b = ((n)-1); y <= _b; y++) {
    int blockSize = rel[y].size();
    checkmax(blockSize, 1);
    cout << blockSize + rel[y].size() << endl;
    int basey = y + 1;
    for (int x = (0), _b = ((blockSize)-1); x <= _b; x++)
      cout << xStart + x << " " << basey << endl;
    for (auto o : rel[y]) {
      cout << nextPos[o] << " " << basey << endl;
      nextPos[o]++;
    }
    xStart += blockSize;
  }
  return 0;
}
