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