#include <bits/stdc++.h>
using namespace std;
string a;
int main() {
  long long l = -1998638045, r = 1998638045, m;
  char x;
  long long n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a >> m >> x;
    if (a == ">=" && x == 'Y' && l < m) {
      l = m;
    }
    if (a == ">=" && x == 'N' && r > m - 1) {
      r = m - 1;
    }
    if (a == ">" && x == 'Y' && l < m + 1) {
      l = m + 1;
    }
    if (a == ">" && x == 'N' && r > m) {
      r = m;
    }
    if (a == "<=" && x == 'Y' && r > m) {
      r = m;
    }
    if (a == "<=" && x == 'N' && l < m + 1) {
      l = m + 1;
    }
    if (a == "<" && x == 'Y' && r > m - 1) {
      r = m - 1;
    }
    if (a == "<" && x == 'N' && l < m) {
      l = m;
    }
  }
  if (l <= r) {
    cout << l;
  } else {
    cout << "Impossible";
  }
  return 0;
}
