#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, aa, bb;
  cin >> a >> b >> aa >> bb;
  if (aa <= bb) aa = bb + 1;
  vector<pair<int, int> > ans;
  if (aa > a) {
    cout << 0;
    return 0;
  } else {
    for (int i = bb; i <= b; i++)
      for (int j = (aa > i + 1 ? aa : i + 1); j <= a; j++) {
        ans.push_back(make_pair(j, i));
      }
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first << ' ' << ans[i].second << '\n';
  return 0;
}
