#include <bits/stdc++.h>
using namespace std;
int x, y, a, b;
int ans = 0;
int main() {
  cin >> x >> y >> a >> b;
  if (x <= b) {
    cout << 0 << '\n';
    return 0;
  }
  while (a <= b) a++;
  for (int i = a; i <= x; i++)
    for (int j = b; j < i && j <= y; j++) ans++;
  cout << ans << '\n';
  for (int i = a; i <= x; i++)
    for (int j = b; j < i && j <= y; j++) cout << i << " " << j << '\n';
  return 0;
}
