#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, a, b;
  scanf("%d %d %d %d", &x, &y, &a, &b);
  bool fail = false;
  set<pair<int, int>> s;
  for (int i = b; i <= y; i++) {
    for (int j = a; j <= x; j++) {
      int v = max(j, i + 1);
      if (v > x) break;
      s.insert(make_pair(v, i));
    }
  }
  printf("%d\n", (int)s.size());
  for (auto it : s) {
    printf("%d %d\n", it.first, it.second);
  }
  return 0;
}
