#include <bits/stdc++.h>
using namespace std;
int n;
int c, d, l = -1e9, r = 1e9;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &c, &d);
    if (d == 1 && l < 1900) l = 1900;
    if (d == 2 && r > 1899) r = 1899;
    l += c;
    r += c;
  }
  if (l > r)
    puts("Impossible");
  else if (r > 200000000)
    puts("Infinity");
  else
    printf("%d\n", r);
  return 0;
}
