#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, first = -2e9, last = 2e9, num;
  string op, ans;
  cin >> n;
  while (n--) {
    cin >> op >> num >> ans;
    if (op == ">=" && ans == "Y" || op == "<" && ans == "N") {
      if (num >= first) first = num;
    } else if (op == ">" && ans == "Y" || op == "<=" && ans == "N") {
      if (num >= first) first = num + 1;
    } else if (op == ">=" && ans == "N" || op == "<" && ans == "Y") {
      if (num - 1 <= last) last = num - 1;
    } else if (op == ">" && ans == "N" || op == "<=" && ans == "Y") {
      if (num <= last) last = num;
    }
  }
  if (first <= last)
    cout << first << endl;
  else
    cout << "Impossible" << endl;
  return 0;
}
