#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int n_ = 1e5 + 1000;
const long double PI = acos(-1.0);
long long gcd(long long a, long long b) { return (a ? gcd(b % a, a) : b); }
long long power(long long a, long long n) {
  long long p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
    }
    n >>= 1;
    a *= a;
  }
  return p;
}
long long power(long long a, long long n, long long mod) {
  long long p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
      p %= mod;
    }
    n >>= 1;
    a *= a;
    a %= mod;
  }
  return p % mod;
}
bool vowel(char ch) {
  if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
    return true;
  else
    return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long C[1005][1005];
  C[0][0] = 1;
  for (long long i = 1; i <= 1004; i++) C[0][i] = 0;
  for (long long i = 1; i <= 1004; i++) C[i][0] = 1;
  for (long long i = 1; i <= 1004; i++)
    for (long long j = 1; j <= 1004; j++)
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD;
  long long n, x;
  char ch;
  string str;
  long long ly = -1 * MOD, ln = -1 * MOD, ry = MOD, rn = MOD;
  cin >> n;
  long long flag = 1;
  for (long long q = 0; q < n; q++) {
    cin >> str >> x >> ch;
    if (str == ">=") {
      if (ch == 'Y') {
        ly = max(ly, x);
      } else {
        rn = min(rn, x - 1);
      }
    }
    if (str == ">") {
      if (ch == 'Y') {
        ly = max(ly, x + 1);
      } else {
        rn = min(rn, x);
      }
    }
    if (str == "<=") {
      if (ch == 'Y') {
        ry = min(ry, x);
      } else {
        ln = max(ln, x + 1);
      }
    }
    if (str == "<") {
      if (ch == 'Y') {
        ry = min(ry, x - 1);
      } else {
        ln = max(ln, x);
      }
    }
    if (max(ln, ly) > min(ry, rn)) flag = 0;
  }
  if (!flag)
    cout << "Impossible";
  else
    cout << max(ln, ly);
  return 0;
}
