#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, a, b, count = 0;
  scanf("%d %d %d %d", &x, &y, &a, &b);
  int l, r = b;
  if (b > a)
    l = b + 1;
  else
    l = a;
  if (l > x)
    printf("0");
  else {
    while (l <= x) {
      while (l > r && r <= y) {
        count++, r++;
      }
      l++, r = b;
    }
    printf("%d\n", count);
    r = b;
    if (b > a)
      l = b + 1;
    else
      l = a;
    while (l <= x) {
      while (l > r && r <= y) {
        printf("%d %d\n", l, r++);
      }
      l++, r = b;
    }
  }
  return 0;
}
