#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:20000000")
using namespace std;
int ri() {
  int x;
  scanf("%d", &x);
  return x;
}
long long rll() {
  long long x;
  scanf("%lld", &x);
  return x;
}
void solve() {
  int lx = -2e9, rx = 2e9;
  int n = ri();
  for (int i = (int)(1); i <= (int)(n); i++) {
    string s;
    cin >> s;
    int x = ri();
    string answer;
    cin >> answer;
    if (answer == "N") {
      if (s == ">=")
        s = "<";
      else if (s == "<=")
        s = ">";
      else if (s == "<")
        s = ">=";
      else if (s == ">")
        s = "<=";
    }
    int l, r;
    if (s == ">=") l = x, r = 2e9;
    if (s == "<=") l = -2e9, r = x;
    if (s == ">") l = x + 1, r = 2e9;
    if (s == "<") l = -2e9, r = x - 1;
    int mx = max(l, lx);
    int mn = min(r, rx);
    if (mx > mn) {
      cout << "Impossible" << endl;
      return;
    }
    lx = mx, rx = mn;
  }
  if (lx == 2e9) lx--;
  cout << lx << endl;
}
int main() {
  solve();
  return 0;
}
