#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long int sum = 0, a = 1e10, b = -1e10;
  while (n--) {
    long long int c, d;
    cin >> c >> d;
    if (d == 1)
      b = max(b, 1900 - sum);
    else
      a = min(a, 1899 - sum);
    sum += c;
  }
  if (b > a) {
    cout << "Impossible";
    return 0;
  }
  if (a == 1e10)
    cout << "Infinity";
  else {
    a += sum;
    cout << a;
  }
}
