#include <bits/stdc++.h>
using namespace std;
void minum(long long int &a, long long int b) { a = min(a, b); }
void maxim(long long int &a, long long int b) { a = max(a, b); }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long int n;
  cin >> n;
  long long int mx = 2000000000;
  long long int mn = -mx;
  while (n--) {
    string s;
    cin >> s;
    long long int x;
    cin >> x;
    char a;
    cin >> a;
    if (a == 'N') {
      if (s == ">=") {
        s = "<";
      } else if (s == ">") {
        s = "<=";
      } else if (s == "<=") {
        s = ">";
      } else if (s == "<") {
        s = ">=";
      }
    }
    if (s == ">=") {
      maxim(mn, x);
    } else if (s == ">") {
      maxim(mn, x + 1);
    } else if (s == "<=") {
      minum(mx, x);
    } else if (s == "<") {
      minum(mx, x - 1);
    }
  }
  if (mn <= mx) {
    cout << mn << endl;
  } else {
    cout << "Impossible" << endl;
  }
}
