#include <bits/stdc++.h>
using namespace std;
int i, j, k, t, n, x, y, z, ans, minn = -2e9, maxx = 2e9;
bool bo;
int main() {
  scanf("%d%d%d", &n, &x, &y);
  if (y == 1)
    minn = 1900;
  else
    maxx = 1899;
  if (y == 2) bo = 1;
  ans += x;
  for (i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    if (y == 2) bo = 1;
    if (y == 1)
      minn = max(minn, 1900 - ans);
    else
      maxx = min(maxx, 1899 - ans);
    ans += x;
  }
  if (minn > maxx)
    printf("Impossible");
  else if (!bo)
    printf("Infinity");
  else
    printf("%d", maxx + ans);
  return 0;
}
