#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
int main() {
  string a, b;
  int l, r, n, m;
  while (cin >> n) {
    l = -0x3f3f3f3f;
    r = 0x3f3f3f3f;
    while (n--) {
      cin >> a >> m >> b;
      if (a == ">=") {
        if (b == "Y")
          l = max(l, m);
        else
          r = min(r, m - 1);
      }
      if (a == ">") {
        if (b == "Y")
          l = max(l, m + 1);
        else
          r = min(r, m);
      }
      if (a == "<=") {
        if (b == "Y")
          r = min(r, m);
        else
          l = max(l, m + 1);
      }
      if (a == "<") {
        if (b == "Y")
          r = min(r, m - 1);
        else
          l = max(l, m);
      }
    }
    if (l > r)
      puts("Impossible");
    else
      cout << l << endl;
  }
  return 0;
}
