#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string sign;
  long long x;
  string ans;
  long long l = -2e9, r = 2e9;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> sign >> x >> ans;
    if (">" == sign) {
      if ("Y" == ans) {
        l = max(l, x + 1);
      } else {
        r = min(r, x);
      }
    } else if ("<" == sign) {
      if ("Y" == ans) {
        r = min(r, x - 1);
      } else {
        l = max(l, x);
      }
    } else if (">=" == sign) {
      if ("Y" == ans) {
        l = max(l, x);
      } else {
        r = min(r, x - 1);
      }
    } else {
      if ("Y" == ans) {
        r = min(r, x);
      } else {
        l = max(l, x + 1);
      }
    }
  }
  if (l <= r) {
    cout << l << endl;
  } else {
    cout << "Impossible" << endl;
  }
  return 0;
}
