#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int min1 = -2000000000;
  long long int max1 = 2000000000;
  while (n--) {
    string str;
    cin >> str;
    if (str.length() == 1 && str[0] == '<') {
      long long int num;
      cin >> num;
      char ch;
      cin >> ch;
      if (ch == 'N') {
        if (min1 < num) min1 = num;
      } else {
        if (max1 >= num) max1 = num - 1;
      }
    }
    if (str.length() == 1 && str[0] == '>') {
      long long int num;
      cin >> num;
      char ch;
      cin >> ch;
      if (ch == 'N') {
        if (max1 > num) max1 = num;
      } else {
        if (min1 <= num) min1 = num + 1;
      }
    }
    if (str.length() == 2 && str[0] == '<' && str[1] == '=') {
      long long int num;
      cin >> num;
      char ch;
      cin >> ch;
      if (ch == 'N') {
        if (min1 <= num) min1 = num;
      } else {
        if (max1 > num) max1 = num;
      }
    }
    if (str.length() == 2 && str[0] == '>' && str[1] == '=') {
      long long int num;
      cin >> num;
      char ch;
      cin >> ch;
      if (ch == 'N') {
        if (max1 >= num) max1 = num - 1;
      } else {
        if (min1 < num) min1 = num;
      }
    }
  }
  if (max1 >= min1)
    cout << max1;
  else
    cout << "Impossible";
  return 0;
}
