#include <bits/stdc++.h>
using namespace std;
typedef long double real;
int n;
int l = -2000000000, r = 2000000000;
int main() {
  scanf("%d", &n);
  while (n--) {
    string type;
    cin >> type;
    int x;
    scanf("%d", &x);
    if (type == "<") {
      type = "<=";
      --x;
    }
    if (type == ">") {
      type = ">=";
      ++x;
    }
    string ans;
    cin >> ans;
    if (type == "<=") {
      if (ans == "Y") {
        r = min(r, x);
      } else {
        l = max(l, x + 1);
      }
    }
    if (type == ">=") {
      if (ans == "Y") {
        l = max(l, x);
      } else {
        r = min(r, x - 1);
      }
    }
    if (l > r) {
      puts("Impossible");
      return 0;
    }
  }
  printf("%d\n", l);
}
