#include <bits/stdc++.h>
using namespace std;
string s;
long long x;
char sp;
int main() {
  int n;
  long long y;
  cin >> n;
  pair<int, int> p;
  p.first = -1e9 - 100, p.second = 1e9 + 100;
  for (int i = 0; i < n; i++) {
    cin >> s >> x >> sp;
    if ((s == "<=" && sp == 'Y') || (s == ">" && sp == 'N')) {
      if (x <= p.second && x >= p.first)
        p.second = x;
      else if (x < p.first) {
        cout << "Impossible";
        return 0;
      }
    } else if ((s == ">=" && sp == 'Y') || (s == "<" && sp == 'N')) {
      if (x <= p.second && x >= p.first)
        p.first = x;
      else if (x > p.second) {
        cout << "Impossible";
        return 0;
      }
    }
    if ((s == "<" && sp == 'Y') || (s == ">=" && sp == 'N')) {
      if (x <= p.second && x >= p.first)
        p.second = x - 1;
      else if (x < p.first) {
        cout << "Impossible";
        return 0;
      }
    } else if ((s == ">" && sp == 'Y') || (s == "<=" && sp == 'N')) {
      if (x <= p.second && x >= p.first)
        p.first = x + 1;
      else if (x > p.second) {
        cout << "Impossible";
        return 0;
      }
    }
  }
  if (p.second < p.first) {
    cout << "Impossible";
    return 0;
  }
  cout << p.first;
  return 0;
}
