#include <bits/stdc++.h>
using namespace std;
int n;
const int N = 10000;
int a[N];
string s[N];
string b;
char t;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> b >> a[i] >> t;
    if (t == 'Y')
      s[i] = b;
    else if (b == "<=")
      s[i] = ">";
    else if (b == ">=")
      s[i] = "<";
    else if (b == "<")
      s[i] = ">=";
    else if (b == ">")
      s[i] = "<=";
  }
  long long high = 2e9;
  long long low = -2e9;
  long long nh, nl;
  nh = high;
  nl = low;
  int r = 0;
  long long w;
  for (int i = 0; i < n; i++) {
    if (s[i] == ">=") {
      nl = a[i];
    } else if (s[i] == "<=") {
      nh = a[i];
    } else if (s[i] == ">") {
      nl = a[i] + 1;
    } else if (s[i] == "<") {
      nh = a[i] - 1;
    }
    if (nh < low || nl > high) {
      r = 1;
      break;
    } else if (nh == high && nl > low) {
      low = nl;
    } else if (nl == low && nh < high) {
      high = nh;
    } else {
      nl = low;
      nh = high;
    }
  }
  if (r == 1)
    cout << "Impossible" << endl;
  else
    cout << low << endl;
  return 0;
}
