#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  char c;
  long long a, l = -2 * 1e9, r = 2 * 1e9;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    scanf("%lld", &a);
    cin >> c;
    if ((s == ">=" && c == 'Y') || (s == "<" && c == 'N'))
      l = max(l, a);
    else if ((s == ">" && c == 'Y') || (s == "<=" && c == 'N'))
      l = max(l, a + 1);
    else if ((s == "<=" && c == 'Y') || (s == ">" && c == 'N'))
      r = min(r, a);
    else if ((s == "<" && c == 'Y') || (s == ">=" && c == 'N'))
      r = min(r, a - 1);
  }
  if (l > r)
    return puts("Impossible");
  else
    cout << l << endl;
  return 0;
}
