#include <bits/stdc++.h>
using namespace std;
struct fastusualread {
  inline int readint() {
    char c;
    while (c = getchar(), (c < '0' || c > '9') && c != '-')
      ;
    bool flag = (c == '-');
    if (flag) {
      c = getchar();
    }
    int x = 0;
    while (c >= '0' && c <= '9') {
      x = x * 10 + c - 48;
      c = getchar();
    }
    return flag ? -x : x;
  }
  inline long long readllint() {
    char c;
    while (c = getchar(), (c < '0' || c > '9') && c != '-')
      ;
    bool flag = (c == '-');
    if (flag) {
      c = getchar();
    }
    long long x = 0;
    while (c >= '0' && c <= '9') {
      x = (long long)x * 10 + c - 48;
      c = getchar();
    }
    return flag ? -x : x;
  }
  inline string readstring() {
    char c;
    while (c = getchar(), (c == ' ' || c == '\n'))
      ;
    string s = "";
    while (c != ' ' && c != '\n') {
      s += c;
      c = getchar();
    }
    return s;
  }
  inline string readlinestring() {
    char c;
    while (c = getchar(), (c == '\n'))
      ;
    string s = "";
    while (c != '\n') {
      s += c;
      c = getchar();
    }
    return s;
  }
} fastread;
struct fastusualprint {
  inline void printnum(int x) {
    if (x < 0) {
      putchar('-'), x = -x;
    }
    register short a[10] = {}, sz = 0;
    while (x) {
      a[sz++] = x % 10;
      x /= 10;
    }
    if (sz == 0) {
      putchar('0');
    }
    for (int i = sz - 1; i >= 0; i--) {
      putchar('0' + a[i]);
    }
  }
  inline void printnum(long long x) {
    if (x < 0LL) {
      putchar('-'), x = -x;
    }
    register short a[20] = {}, sz = 0;
    while (x) {
      a[sz++] = x % 10;
      x /= 10;
    }
    if (sz == 0) {
      putchar('0');
    }
    for (int i = sz - 1; i >= 0; i--) {
      putchar('0' + a[i]);
    }
  }
  inline void printstring(string s) {
    for (auto x : s) {
      putchar(x);
    }
  }
  inline void printnumln(int x) {
    if (x < 0) {
      putchar('-'), x = -x;
    }
    register short a[10] = {}, sz = 0;
    while (x) {
      a[sz++] = x % 10;
      x /= 10;
    }
    if (sz == 0) {
      putchar('0');
    }
    for (int i = sz - 1; i >= 0; i--) {
      putchar('0' + a[i]);
    }
    putchar('\n');
  }
  inline void printnumln(long long x) {
    if (x < 0LL) {
      putchar('-'), x = -x;
    }
    register short a[20] = {}, sz = 0;
    while (x) {
      a[sz++] = x % 10;
      x /= 10;
    }
    if (sz == 0) {
      putchar('0');
    }
    for (int i = sz - 1; i >= 0; i--) {
      putchar('0' + a[i]);
    }
    putchar('\n');
  }
  inline void printstringln(string s) {
    for (auto x : s) {
      putchar(x);
    }
    putchar('\n');
  }
} fastprint;
const int Maxn = 200005;
int c[Maxn], d[Maxn], rating[Maxn], n, i;
int main() {
  n = fastread.readint();
  for (int i = 0; i < n; i++) {
    c[i] = fastread.readint();
    d[i] = fastread.readint();
  }
  rating[n] = 0;
  for (int i = n - 1; i >= 0; i--) {
    rating[i] = rating[i + 1] - c[i];
  }
  int mx = -1e9, mn = 1e9;
  for (int i = 0; i < n; i++) {
    if (d[i] == 1) {
      mx = max(mx, 1900 - rating[i]);
    } else {
      mn = min(mn, 1899 - rating[i]);
    }
  }
  if (mx > mn) {
    cout << "Impossible" << endl;
  } else if (mn == 1e9) {
    cout << "Infinity" << endl;
  } else {
    cout << mn << endl;
  }
  fprintf(stderr, "\n\nSystem Time : %d ms", clock()), fflush(stderr);
  return 0;
}
