#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  int lower = -2000000000, higher = 2000000000;
  int lower_stat = 1, higher_stat = 1;
  int n, i, num;
  bool lt, le, gt, ge, imposs = false;
  char c;
  scanf("%d", &n);
  while (n--) {
    lt = le = gt = ge = false;
    cin >> str >> num >> c;
    if (imposs) continue;
    if (c == 'N') {
      if (str.compare(">=") == 0)
        lt = true;
      else if (str.compare(">") == 0)
        le = true;
      else if (str.compare("<") == 0)
        ge = true;
      else
        gt = true;
    } else {
      if (str.compare(">=") == 0)
        ge = true;
      else if (str.compare(">") == 0)
        gt = true;
      else if (str.compare("<") == 0)
        lt = true;
      else
        le = true;
    }
    if (ge) {
      if (num > lower) {
        lower = num;
        lower_stat = 1;
      }
    } else if (gt) {
      if (num > lower) {
        lower = num;
        lower_stat = 0;
      } else if (num == lower) {
        lower_stat = 0;
      }
    } else if (le) {
      if (num < higher) {
        higher = num;
        higher_stat = 1;
      }
    } else if (lt) {
      if (num < higher) {
        higher = num;
        higher_stat = 0;
      }
      higher_stat = 0;
    }
    if (lower > higher) {
      imposs = true;
    } else if (lower == higher) {
      if (lower_stat + higher_stat <= 1) {
        imposs = true;
      }
    } else if ((higher - lower == 1) && higher_stat == 0 && lower_stat == 0) {
      imposs = true;
    }
  }
  if (imposs) {
    printf("Impossible\n");
    return 0;
  }
  if (lower_stat == 1)
    printf("%d\n", lower);
  else if (higher_stat == 1)
    printf("%d\n", higher);
  else
    printf("%d\n", lower + 1);
  return 0;
}
