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