#include <bits/stdc++.h>
using namespace std;
const int inf = 200000000;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int idx = 1;
  pair<int, int> bond;
  bond.first = -inf;
  bond.second = inf;
  for (int i = 1; i <= n; i++) {
    int rate, div;
    cin >> rate >> div;
    if (bond.second < bond.first) idx = 0;
    if (div == 1) {
      bond.first = max(bond.first, 1900);
    } else
      bond.second = min(bond.second, 1899);
    if (bond.second < bond.first) idx = 0;
    bond.first += rate;
    bond.second += rate;
  }
  if (bond.second < bond.first) idx = 0;
  if (!idx)
    cout << "Impossible" << endl;
  else {
    if (bond.second > 100000000)
      cout << "Infinity" << endl;
    else
      cout << bond.second << endl;
  }
}
