#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  long long m, n;
  cin >> T;
  m = -2e9;
  n = 2e9;
  while (T--) {
    string s;
    long long num;
    char ans;
    cin >> s >> num >> ans;
    if (s == ">") {
      if (ans == 'Y')
        m = max(m, num + 1);
      else
        n = min(n, num);
    } else if (s == ">=") {
      if (ans == 'Y')
        m = max(m, num);
      else
        n = min(n, num - 1);
    } else if (s == "<") {
      if (ans == 'Y')
        n = min(n, num - 1);
      else
        m = max(m, num);
    } else if (s == "<=") {
      if (ans == 'Y')
        n = min(n, num);
      else
        m = max(m, num + 1);
    }
  }
  if (m > n)
    cout << "Impossible" << endl;
  else
    printf("%I64d\n", m);
  return 0;
}
