#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  scanf("%d", &n);
  string s;
  char z;
  int x;
  int mx = 1e9;
  mx += 9;
  int mn = -mx;
  while (n--) {
    cin >> s >> x >> z;
    if (z == 'N') {
      if (s == ">")
        s = "<=";
      else if (s == "<")
        s = ">=";
      else if (s == ">=")
        s = "<";
      else
        s = ">";
    }
    if (s == ">")
      mn = max(mn, x + 1);
    else if (s == ">=")
      mn = max(mn, x);
    else if (s == "<")
      mx = min(mx, x - 1);
    else if (s == "<=")
      mx = min(mx, x);
  }
  if (mn <= mx)
    printf("%d", mn);
  else
    printf("Impossible");
  return 0;
}
