#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  int low = -2e9, high = 2e9;
  for (int i = 0; i < n; i++) {
    string e;
    int num;
    string query;
    cin >> e >> num >> query;
    if (query == "Y") {
      if (e == ">=") {
        low = max(low, num);
      } else if (e == "<") {
        high = min(high, num - 1);
      } else if (e == "<=") {
        high = min(high, num);
      } else {
        low = max(low, num + 1);
      }
    } else {
      if (e == ">=") {
        high = min(high, num - 1);
      } else if (e == "<") {
        low = max(low, num);
      } else if (e == "<=") {
        low = max(low, num + 1);
      } else {
        high = min(high, num);
      }
    }
  }
  if (low > high)
    cout << "Impossible";
  else if (low == -1e9)
    cout << high;
  else
    cout << low;
  return 0;
}
