#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int x = -1000000009;
  int y = 1000000009;
  string s, c;
  int z;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s >> z >> c;
    if ((s == ">" && c == "Y" || s == "<=" && c == "N") && z + 1 > x) x = z + 1;
    if ((s == ">=" && c == "Y" || s == "<" && c == "N") && z > x) x = z;
    if ((s == ">" && c == "N" || s == "<=" && c == "Y") && z < y) y = z;
    if ((s == ">=" && c == "N" || s == "<" && c == "Y") && z - 1 < y) y = z - 1;
  }
  if (x > y)
    cout << "Impossible" << endl;
  else
    cout << x << endl;
  return 0;
}
