#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  long long lb = 0, ub = 0;
  bool det = true;
  for (long long i = 0; i < n; i++) {
    long long c, d;
    cin >> c >> d;
    if (i == 0) {
      if (d == 1) {
        lb = 1900;
        ub = 1000000000ll * 1000000000ll;
      } else {
        lb = -1000000000ll * 1000000000ll;
        ub = 1899;
      }
    }
    if ((d == 1 && ub < 1900) || (d == 2 && lb >= 1900)) det = false;
    if (d == 1) {
      lb = max(lb, 1900ll);
    } else {
      ub = min(ub, 1899ll);
    }
    lb += c;
    ub += c;
  }
  if (det) {
    if (ub > 1000000000ll)
      cout << "Infinity" << endl;
    else
      cout << ub << endl;
  } else {
    cout << "Impossible" << endl;
  }
}
