#include <bits/stdc++.h>
long long h = 2000000000 + 10, l = -h, ans, mid;
using namespace std;
int main() {
  int n, k;
  scanf("%d", &n);
  char str[10], t[10];
  for (int i = int(0); i < int(n); i++) {
    memset(str, 0, sizeof(str));
    scanf("%s", str);
    scanf("%I64d", &mid);
    scanf("%s", t);
    if (str[0] == '>') {
      if (str[1] == '=') {
        if (t[0] == 'Y')
          k = 1;
        else
          k = 2;
      } else {
        if (t[0] == 'Y')
          k = 3;
        else
          k = 4;
      }
    } else {
      if (str[1] == '=') {
        if (t[0] == 'Y')
          k = 4;
        else
          k = 3;
      } else {
        if (t[0] == 'Y')
          k = 2;
        else
          k = 1;
      }
    }
    switch (k) {
      case 1:
        l = max(l, mid);
        break;
      case 2:
        h = min(h, mid - 1);
        break;
      case 3:
        l = max(l, mid + 1);
        break;
      case 4:
        h = min(h, mid);
        break;
    }
  }
  if (h >= l)
    printf("%d\n", (h + l) >> 1);
  else
    printf("Impossible\n");
  return 0;
}
