#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
void solve() {}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string sign;
  long long x;
  char c;
  long long lowerBound = INT_MIN, upperBound = INT_MAX;
  while (n--) {
    cin >> sign >> x >> c;
    if (c == 'Y') {
      if (sign == ">=")
        lowerBound = max(lowerBound, x);
      else if (sign == "<=")
        upperBound = min(upperBound, x);
      else if (sign == ">")
        lowerBound = max(lowerBound, x + 1);
      else if (sign == "<")
        upperBound = min(upperBound, x - 1);
    } else if (c == 'N') {
      if (sign == ">=")
        upperBound = min(upperBound, x - 1);
      else if (sign == "<=")
        lowerBound = max(lowerBound, x + 1);
      else if (sign == ">")
        upperBound = min(upperBound, x);
      else if (sign == "<")
        lowerBound = max(lowerBound, x);
    }
  }
  if (upperBound < lowerBound)
    cout << "Impossible\n";
  else
    cout << (upperBound + lowerBound) / 2 << '\n';
}
