#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, min_rating = -999999999, max_rating = 999999999;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int c, d;
    cin >> c >> d;
    if (d == 2) {
      if (min_rating >= 1900) {
        cout << "Impossible";
        return 0;
      }
      max_rating = min(max_rating, 1899);
    } else {
      if (max_rating < 1900) {
        cout << "Impossible";
        return 0;
      }
      min_rating = max(min_rating, 1900);
    }
    min_rating += c;
    max_rating += c;
  }
  if (max_rating < 900000000) {
    cout << max_rating;
  } else {
    cout << "Infinity";
  }
}
