#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string q[10100], a[10100];
  int nq[10100];
  for (int i = 0; i < n; i++) cin >> q[i] >> nq[i] >> a[i];
  bool imp = false;
  int llim = -2000000000, rlim = 2000000000;
  for (int i = 0; i < n; i++) {
    if (q[i] == ">=") {
      if (a[i] == "Y")
        llim = max(llim, nq[i]);
      else
        rlim = min(rlim, nq[i] - 1);
    }
    if (q[i] == "<=") {
      if (a[i] == "Y")
        rlim = min(rlim, nq[i]);
      else
        llim = max(llim, nq[i] + 1);
    }
    if (q[i] == ">") {
      if (a[i] == "Y")
        llim = max(llim, nq[i] + 1);
      else
        rlim = min(rlim, nq[i]);
    }
    if (q[i] == "<") {
      if (a[i] == "Y")
        rlim = min(rlim, nq[i] - 1);
      else
        llim = max(llim, nq[i]);
    }
    if (llim > rlim) imp = true;
  }
  if (imp)
    printf("Impossible\n");
  else
    printf("%d\n", llim);
  return 0;
}
