#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, x, d, u;
  char ans, q[10], line[100];
  bool checkd = false, checku = false;
  scanf("%d", &n);
  gets(line);
  for (i = 1; i <= n; i++) {
    gets(line);
    sscanf(line, "%s %d %c", &q, &x, &ans);
    if (ans == 'Y') {
      if (strlen(q) == 1) {
        if (q[0] == '>') {
          if (checkd)
            d = max(d, x + 1);
          else {
            d = x + 1;
            checkd = true;
          }
        } else {
          if (checku)
            u = min(u, x - 1);
          else {
            u = x - 1;
            checku = true;
          }
        }
      } else {
        if (q[0] == '>') {
          if (checkd)
            d = max(d, x);
          else {
            d = x;
            checkd = true;
          }
        } else {
          if (checku)
            u = min(u, x);
          else {
            u = x;
            checku = true;
          }
        }
      }
    } else {
      if (strlen(q) == 1) {
        if (q[0] == '>') {
          if (checku)
            u = min(u, x);
          else {
            u = x;
            checku = true;
          }
        } else {
          if (checkd)
            d = max(d, x);
          else {
            d = x;
            checkd = true;
          }
        }
      } else {
        if (q[0] == '>') {
          if (checku)
            u = min(u, x - 1);
          else {
            u = x - 1;
            checku = true;
          }
        } else {
          if (checkd)
            d = max(d, x + 1);
          else {
            d = x + 1;
            checkd = true;
          }
        }
      }
    }
  }
  if (d > u && checku && checkd)
    printf("Impossible");
  else if (checkd)
    printf("%d", d);
  else if (checku)
    printf("%d", u);
  else
    printf("0");
}
