#include <bits/stdc++.h>
using namespace std;
vector<pair<long int, string> > v;
vector<pair<long int, string> >::iterator it;
int main() {
  long int i, j, k, l, n, m, T, f, p, ans, cnt, par, ele, r1, r2, mn, mx,
      ar[100005];
  char x;
  string s[100005], a, b, c, d, t;
  a = "<=";
  b = ">=";
  c = "<";
  d = ">";
  scanf("%ld", &n);
  mn = 1000000007;
  mx = -1000000007;
  for (i = 0; i < n; i++) {
    cin >> s[i];
    cin >> ar[i];
    cin >> x;
    if (s[i] == a && x == 'N')
      s[i] = d;
    else if (s[i] == b && x == 'N')
      s[i] = c;
    else if (s[i] == c && x == 'N')
      s[i] = b;
    else if (s[i] == d && x == 'N')
      s[i] = a;
    if (s[i] == a) mn = min(mn, ar[i]);
    if (s[i] == b) mx = max(mx, ar[i]);
    if (s[i] == c) mn = min(mn, ar[i] - 1);
    if (s[i] == d) mx = max(mx, ar[i] + 1);
  }
  if (mx <= mn)
    printf("%ld\n", mn);
  else
    printf("Impossible");
  return 0;
}
