#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int n;
  long long int l = -2e9, r = 2e9;
  cin >> n;
  string s;
  char ch;
  for (long long int i = 0, x; i < n; i++) {
    cin >> s >> x >> ch;
    if ((s == ">" && ch == 'Y') || (s == "<=" && ch == 'N')) {
      l = max(x + 1, l);
    }
    if ((s == ">=" && ch == 'Y') || (s == "<" && ch == 'N')) {
      l = max(x, l);
    }
    if ((s == "<" && ch == 'Y') || (s == ">=" && ch == 'N')) {
      r = min(x - 1, r);
    }
    if ((s == "<=" && ch == 'Y') || (s == ">" && ch == 'N')) {
      r = min(x, r);
    }
  }
  if (l > r) {
    cout << "Impossible";
  } else {
    cout << l;
  }
  return 0;
}
