#include <bits/stdc++.h>
using namespace std;
int N;
int main() {
  cin >> N;
  int k = 0;
  int l = -1145141919, r = 1145141919;
  for (int i = 0; i < N; i++) {
    int a, b;
    cin >> a >> b;
    if (b == 1)
      l = max(l, 1900 - k);
    else
      r = min(r, 1900 - k);
    k += a;
  }
  if (r == 1145141919)
    cout << "Infinity\n";
  else if (r <= l)
    cout << "Impossible\n";
  else {
    cout << (r - 1) + k << "\n";
  }
  return 0;
}
