#include <bits/stdc++.h>
using namespace std;
int n, k, m;
int x[200005], d[200005];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> d[i];
  int inf = 1e9, t = -inf, cnt = 0;
  for (int i = 0; i < n; i++) {
    if (d[i] == 1)
      t = max(t, 1900 - cnt);
    else
      inf = min(inf, 1899 - cnt);
    cnt += x[i];
  }
  if (t > inf)
    cout << "Impossible" << endl;
  else if (inf == int(1e9))
    cout << "Infinity" << endl;
  else
    cout << cnt + inf;
  return 0;
}
