#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
long long n, l, x, y, mn = 1e9, mx = -1e9;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x >> y;
    if (y == 1)
      mx = max(mx, 1900 * 1ll);
    else
      mn = min(mn, 1899 * 1ll);
    mn += x, mx += x;
  }
  if (mx > mn)
    cout << "Impossible";
  else if (mn > 5e8)
    cout << "Infinity";
  else
    cout << mn;
}
