#include <bits/stdc++.h>
using namespace std;
int dcmp(double x, double y) {
  return fabs(x - y) <= 1e-9 ? 0 : x < y ? -1 : 1;
};
int main() {
  long long n, tmp;
  char ans;
  string cmp;
  cin >> n;
  long long left = -2 * 1e9;
  long long right = 2 * 1e9;
  long long maxl = left;
  long long minR = right;
  while (n--) {
    cin >> cmp >> tmp >> ans;
    if (cmp.find(">=") != string::npos) {
      if (ans == 'Y') {
        left = tmp;
        maxl = max(left, maxl);
      } else {
        right = tmp - 1;
        minR = min(right, minR);
      }
    } else if (cmp.find(">") != string::npos) {
      if (ans == 'Y') {
        left = tmp + 1;
        maxl = max(left, maxl);
      } else {
        right = tmp;
        minR = min(right, minR);
      }
    } else if (cmp.find("<=") != string::npos) {
      if (ans == 'Y') {
        right = tmp;
        minR = min(right, minR);
      } else {
        left = tmp + 1;
        maxl = max(left, maxl);
      }
    } else if (cmp.find("<") != string::npos) {
      if (ans == 'Y') {
        right = tmp - 1;
        minR = min(right, minR);
      } else {
        left = tmp;
        maxl = max(left, maxl);
      }
    }
  }
  if (minR < maxl) {
    cout << "Impossible" << '\n';
  } else {
    cout << maxl << '\n';
  }
}
