#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  long long st = -2 * 1e9, e = 2 * 1e9, temp;
  string s;
  char c;
  bool bb = true;
  while (n--) {
    cin >> s >> temp >> c;
    if (s == ">=") {
      if (c == 'Y')
        st = max(st, temp);
      else
        e = min(e, temp - 1);
    } else if (s == ">") {
      if (c == 'Y')
        st = st = max(st, temp + 1);
      else
        e = min(e, temp);
    } else if (s == "<=") {
      if (c == 'Y')
        e = min(e, temp);
      else
        st = max(st, temp + 1);
    } else if (s == "<") {
      if (c == 'Y')
        e = min(e, temp - 1);
      else
        st = max(st, temp);
    }
    if (st > e) bb = false;
  }
  if (bb)
    cout << st;
  else
    cout << "Impossible";
}
