#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c, d;
  long long left, right, sum, initial;
  left = -0x3f3f3f3f, right = 0x3f3f3f3f;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> c >> d;
    if (i == 1) {
      if (d == 1)
        left = 1900;
      else
        right = 1899;
      sum += c;
    } else {
      if (d == 1) {
        initial = 1900 - sum;
        left = max(left, initial);
      } else {
        initial = 1899 - sum;
        right = min(right, initial);
      }
      sum += c;
    }
  }
  if (left > right)
    cout << "Impossible" << endl;
  else if (right == 0x3f3f3f3f)
    cout << "Infinity" << endl;
  else
    cout << right + sum << endl;
  return 0;
}
