#include <bits/stdc++.h>
using namespace std;
long long int p[114514] = {};
int main() {
  long long int n;
  cin >> n;
  vector<pair<long long int, pair<long long int, long long int> > > v;
  long long int p = 0;
  for (long long int i = 0; i < n; i++) {
    long long int a, b;
    cin >> a >> b;
    v.push_back(make_pair(a - b, make_pair(a, b)));
    p += a;
  }
  sort(v.begin(), v.end());
  cout << "0 1" << endl;
  return 0;
}
