#include <bits/stdc++.h>
using namespace std;
int main() {
  long long lb = -999999999, tb = 999999999, n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    long long del, div;
    cin >> del >> div;
    if (div == 1) {
      lb = max(1900ll, lb);
    } else {
      tb = min(1899ll, tb);
    }
    lb += del;
    tb += del;
    if (tb < lb) {
      cout << "Impossible";
      return 0;
    }
  }
  if (tb > 900000000) {
    cout << "Infinity";
  } else {
    cout << tb;
  }
  return 0;
}
