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