#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int main(void) {
  int n;
  scanf("%d", &n);
  long long int maxp = 1e8;
  long long int minp = -1e8;
  int inf = 1;
  for (int i = 0; i < n; ++i) {
    int c;
    scanf("%d", &c);
    int div;
    scanf("%d", &div);
    if (div == 2 && maxp >= 1900) maxp = 1899, inf = 0;
    if (div == 1 && minp < 1900) minp = 1900;
    maxp += c;
    minp += c;
  }
  if (minp <= maxp) {
    if (inf)
      printf("Infinity\n");
    else
      printf("%lld\n", maxp);
  } else
    printf("Impossible\n");
  return (0);
}
