#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int ans = 0;
  if (a <= d) {
    cout << ans;
    return 0;
  }
  if (d >= c) c = d + 1;
  for (int i = c; i <= a; i++)
    for (int j = d; j < i; j++) {
      ans++;
      if (j == b) break;
    }
  cout << ans << endl;
  for (int i = c; i <= a; i++)
    for (int j = d; j < i; j++) {
      cout << i << " " << j << endl;
      if (j == b) break;
    }
  return 0;
}
