#include <bits/stdc++.h>
using namespace std;
int n, c[200000 + 5], d[200000 + 5];
long long maxx = 0xfffffffffffffff;
long long minn = -0xfffffffffffffff;
int flag = 0;
bool judge() {
  if (minn <= maxx)
    return true;
  else
    return false;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &c[i], &d[i]);
    if (d[i] == 1) {
      if (maxx < 1900) {
        printf("Impossible\n");
        return 0;
      }
      minn = max(minn, 1900LL);
      minn += c[i];
      maxx += c[i];
    } else {
      if (minn >= 1900) {
        printf("Impossible\n");
        return 0;
      }
      maxx = min(maxx, 1899LL);
      maxx += c[i];
      flag = 1;
      minn += c[i];
    }
    if (!judge() && flag) {
      printf("Impossible\n");
      return 0;
    }
  }
  if (!flag)
    printf("Infinity\n");
  else
    printf("%I64d\n", maxx);
  return 0;
}
