#include <bits/stdc++.h>
using namespace std;
const char nl = '\n';
inline int _min(const register int& x, const register int& y) {
  return x < y ? x : y;
}
inline int _max(const register int& x, const register int& y) {
  return x > y ? x : y;
}
void solve() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long q, num, min = -2000000000, max = 2000000000;
  string op;
  char ans;
  cin >> q;
  for (long long i = 0; i < q; i++) {
    cin >> op >> num >> ans;
    if (op == ">=") {
      if (ans == 'Y') {
        min = std::max(num, min);
      } else {
        max = std::min(num - 1, max);
      }
    } else if (op == ">") {
      if (ans == 'Y') {
        min = std::max(num + 1, min);
      } else {
        max = std::min(num, max);
      }
    } else if (op == "<") {
      if (ans == 'N') {
        min = std::max(num, min);
      } else {
        max = std::min(num - 1, max);
      }
    } else {
      if (ans == 'N') {
        min = std::max(num + 1, min);
      } else {
        max = std::min(num, max);
      }
    }
  }
  if (min > max)
    cout << "Impossible\n" << nl;
  else
    cout << min;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  solve();
  return 0;
}
