#include <bits/stdc++.h>
using namespace std;
string s;
int n, l, r, x;
char a;
void op() {
  if (s == "<=")
    s = ">";
  else if (s == "<")
    s = ">=";
  else if (s == ">=")
    s = "<";
  else
    s = "<=";
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  l = -1000000001, r = -l;
  for (int i = 0; i < n; i++) {
    cin >> s >> x >> a;
    if (a == 'N') op();
    if (s == "<=" && x <= r)
      r = x;
    else if (s == "<" && x - 1 <= r)
      r = x - 1;
    else if (s == ">=" && x >= l)
      l = x;
    else if (s == ">" && x + 1 >= l)
      l = x + 1;
    if (l > r) {
      cout << "Impossible";
      return 0;
    }
  }
  cout << l;
  return 0;
}
