#include <bits/stdc++.h>
int main() {
  int n, max = 1000000001, min = -1000000001, w;
  char op[3], p[2];
  scanf("%d", &n);
  while (n--) {
    scanf("%s%d%s", op, &w, p);
    if (p[0] == 'Y') {
      if (op[0] == '>' && op[1] == '\0' && min < w + 1)
        min = w + 1;
      else if (op[0] == '>' && op[1] == '=' && min < w)
        min = w;
      else if (op[0] == '<' && op[1] == '\0' && max > w - 1)
        max = w - 1;
      else if (op[0] == '<' && op[1] == '=' && max > w)
        max = w;
    } else if (p[0] == 'N') {
      if (op[0] == '>' && op[1] == '\0' && max > w)
        max = w;
      else if (op[0] == '>' && op[1] == '=' && max > w - 1)
        max = w - 1;
      else if (op[0] == '<' && op[1] == '\0' && min < w)
        min = w;
      else if (op[0] == '<' && op[1] == '=' && min < w + 1)
        min = w + 1;
    }
  }
  if (min <= max)
    printf("%d\n", (min + max) / 2);
  else
    printf("Impossible\n");
  return 0;
}
