#include <bits/stdc++.h>
using namespace std;
int main() {
  long long c = -2000000000;
  long long a = 2000000000;
  string s1;
  string s2;
  int b;
  int n;
  cin >> n;
  int i;
  for (i = 0; i < n; i++) {
    s1 = "";
    s2 = "";
    cin >> s1;
    cin >> b;
    cin >> s2;
    if ((s1 == ">" && s2 == "Y") || (s1 == "<=" && s2 == "N")) {
      if (b >= c) c = b + 1;
    } else if ((s1 == ">=" && s2 == "Y") || (s1 == "<" && s2 == "N")) {
      if (b >= c) c = b;
    } else if ((s1 == "<" && s2 == "Y") || (s1 == ">=" && s2 == "N")) {
      if (b <= a) a = b - 1;
    } else if ((s1 == "<=" && s2 == "Y") || (s1 == ">" && s2 == "N")) {
      if (b <= a) a = b;
    }
  }
  if (c < a)
    cout << (c + a) / 2;
  else if (c == a)
    cout << c;
  else
    cout << "Impossible";
  return 0;
}
