#include <bits/stdc++.h>
using namespace std;
int main() {
  int l = -2000000000, r = 2000000000, n, x;
  string s, answer;
  scanf("%d", &n);
  while (n > 0) {
    n--;
    cin >> s >> x >> answer;
    if (s == ">") {
      if (answer == "Y")
        l = max(l, x);
      else
        r = min(x + 1, r);
    }
    if (s == ">=") {
      if (answer == "Y")
        l = max(l, x - 1);
      else
        r = min(x, r);
    }
    if (s == "<") {
      if (answer == "Y")
        r = min(x, r);
      else
        l = max(l, x - 1);
    }
    if (s == "<=") {
      if (answer == "Y")
        r = min(x + 1, r);
      else
        l = max(l, x);
    }
  }
  if (l + 2 <= r)
    printf("%d", l + 1);
  else
    printf("Impossible");
}
