#include <bits/stdc++.h>
using namespace std;
int a, d[100005], f, g, h, j, k, l, i, n, m, b, b1, c, c1, res,
    mn = -2000000000, mx = 2000000000;
string s, x;
int main() {
  mx = 2000000000;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> s >> a >> x;
    if (s == "<") {
      if (x == "Y")
        mx = min(a - 1, mx);
      else
        mn = max(a, mn);
    }
    if (s == ">") {
      if (x == "Y")
        mn = max(a + 1, mn);
      else
        mx = min(a, mx);
    }
    if (s == "<=") {
      if (x == "Y")
        mx = min(a, mx);
      else
        mn = max(a + 1, mn);
    }
    if (s == ">=") {
      if (x == "Y")
        mn = max(a, mn);
      else
        mx = min(a - 1, mx);
    }
  }
  if (mn <= mx)
    cout << mn;
  else
    cout << "Impossible";
}
