#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
const int inf = (int)2e9;
int n;
vector<int> a;
void solve() {
  string sign, reply;
  int x, n, Ml = -inf, Mr = inf;
  cin >> n;
  while (n--) {
    cin >> sign >> x >> reply;
    if (sign == "<") {
      if (reply == "Y")
        Mr = min(Mr, x - 1);
      else
        Ml = max(Ml, x);
    } else if (sign == "<=") {
      if (reply == "Y")
        Mr = min(Mr, x);
      else
        Ml = max(Ml, x + 1);
    } else if (sign == ">") {
      if (reply == "Y")
        Ml = max(Ml, x + 1);
      else
        Mr = min(Mr, x);
    } else {
      if (reply == "Y")
        Ml = max(Ml, x);
      else
        Mr = min(Mr, x - 1);
    }
  }
  if (Ml <= Mr)
    cout << Ml << "\n";
  else
    cout << "Impossible\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
