#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  while (cin >> n) {
    string comm;
    long long num;
    char ans;
    long long lager = -2000000000;
    long long small = 2000000000;
    while (n--) {
      cin >> comm >> num >> ans;
      if (comm == ">=") {
        if (ans == 'Y' && num > lager)
          lager = num;
        else if (ans == 'N' && small >= num)
          small = num - 1;
      } else if (comm == ">") {
        if (ans == 'Y' && num >= lager)
          lager = num + 1;
        else if (ans == 'N' && small > num)
          small = num;
      } else if (comm == "<=") {
        if (ans == 'Y' && small > num)
          small = num;
        else if (ans == 'N' && num >= lager)
          lager = num + 1;
      } else if (comm == "<") {
        if (ans == 'Y' && small >= num)
          small = num - 1;
        else if (ans == 'N' && num > lager)
          lager = num;
      }
    }
    if (lager <= small)
      cout << lager << endl;
    else
      cout << "Impossible" << endl;
  }
  return 0;
}
