#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, lb = INT_MIN, ub = INT_MAX, x;
  cin >> n;
  string sign;
  char yorn;
  while (n--) {
    cin >> sign >> x >> yorn;
    if (sign == ">=" && yorn == 'Y')
      lb = max(lb, x);
    else if (sign == ">" && yorn == 'Y')
      lb = max(lb, x + 1);
    else if (sign == "<" && yorn == 'N')
      lb = max(lb, x);
    else if (sign == "<=" && yorn == 'N')
      lb = max(lb, x + 1);
    else if (sign == ">=" && yorn == 'N')
      ub = min(ub, x - 1);
    else if (sign == ">" && yorn == 'N')
      ub = min(ub, x);
    else if (sign == "<" && yorn == 'Y')
      ub = min(ub, x - 1);
    else if (sign == "<=" && yorn == 'Y')
      ub = min(ub, x);
  }
  if (lb > ub)
    cout << "Impossible";
  else {
    if (lb != INT_MIN)
      cout << lb;
    else
      cout << ub;
  }
  return 0;
}
