#include <bits/stdc++.h>
using namespace std;
int n, c, d, Min, Max, i;
int main() {
  scanf("%d", &n);
  Min = -1000000000;
  Max = 1000000000;
  scanf("%d %d", &c, &d);
  if (d == 1)
    Min = 1900;
  else
    Max = 1899;
  Min += c;
  Max += c;
  for (i = 2; i <= n; i++) {
    scanf("%d %d", &c, &d);
    if (d == 1 && Min < 1900) Min = 1900;
    if (d == 2 && Max > 1899) Max = 1899;
    Min += c;
    Max += c;
    if (Min > Max) break;
  }
  if (i <= n)
    printf("Impossible");
  else if (Max > 100000000)
    printf("Infinity");
  else
    printf("%d", Max);
  return 0;
}
