#include <bits/stdc++.h>
using namespace std;
int n;
pair<int, int> contest[200005];
int main() {
  int i, j;
  int now = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) cin >> contest[i].first >> contest[i].second;
  int l = -0x3f3f3f3f, r = 0x3f3f3f3f;
  for (i = 1; i <= n; i++) {
    if (contest[i].second == 2) {
      r = min(1899, r) + contest[i].first;
      if (l != -0x3f3f3f3f) l += contest[i].first;
    } else {
      l = max(1900, l) + contest[i].first;
      if (r != 0x3f3f3f3f) r += contest[i].first;
    }
  }
  if (r < l)
    cout << "Impossible" << endl;
  else if (r == 0x3f3f3f3f)
    cout << "Infinity" << endl;
  else
    cout << r << endl;
}
