#include <bits/stdc++.h>
using namespace std;
int checkLower(string op, string sw) {
  if (sw == "Y") {
    if (op == ">")
      return 1;
    else if (op == ">=")
      return 0;
    else
      return -1;
  } else {
    if (op == "<")
      return 0;
    else if (op == "<=")
      return 1;
    else
      return -1;
  }
}
int checkUpper(string op, string sw) {
  if (sw == "Y") {
    if (op == "<")
      return 1;
    else if (op == "<=")
      return 0;
    else
      return -1;
  } else {
    if (op == ">")
      return 0;
    else if (op == ">=")
      return 1;
    else
      -1;
  }
}
int main() {
  int n;
  cin >> n;
  long long lowerB = -1e10, upperB = 1e10;
  for (int i = 0; i < n; i++) {
    string op, sw;
    long long a;
    cin >> op >> a >> sw;
    if (checkLower(op, sw) == 1) {
      if (lowerB < a + 1) lowerB = a + 1;
    } else if (checkLower(op, sw) == 0) {
      if (lowerB < a + 1) lowerB = a;
    }
    if (checkUpper(op, sw) == 1) {
      if (upperB >= a - 1) upperB = a - 1;
    } else if (checkUpper(op, sw) == 0) {
      if (upperB >= a) upperB = a;
    }
  }
  if (upperB >= lowerB) {
    if (upperB == 1e10)
      cout << lowerB << endl;
    else
      cout << upperB << endl;
  } else
    cout << "Impossible" << endl;
  cerr << upperB << lowerB;
  return 0;
}
