#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c, l, r, flag, m;
  char a[5], b[5];
  while (scanf("%d", &n) != EOF) {
    l = -2000000000;
    r = 2000000000;
    flag = 1;
    while (n--) {
      memset(a, 0, sizeof(a));
      memset(b, 0, sizeof(b));
      scanf("%s", a);
      scanf("%d", &c);
      scanf("%s", b);
      if (!flag) continue;
      int s = strlen(a);
      if (b[0] == 'Y')
        m = 1;
      else
        m = 0;
      if ((s == 2 && a[0] == '>') || (s == 1 && a[0] == '<')) {
        if ((s == 1 && m) || (s == 2 && !m)) {
          if (l >= c)
            flag = 0;
          else
            r = min(r, c - 1);
        } else {
          if (r < c)
            flag = 0;
          else
            l = max(l, c);
        }
      }
      if ((s == 2 && a[0] == '<') || (s == 1 && a[0] == '>')) {
        if ((s == 1 && m) || (s == 2 && !m)) {
          if (r < c)
            flag = 0;
          else
            l = max(l, c + 1);
        } else {
          if (l > c)
            flag = 0;
          else
            r = min(r, c);
        }
      }
    }
    if (!flag)
      printf("Impossible\n");
    else
      printf("%d\n", l);
  }
  return 0;
}
