#include <bits/stdc++.h>
using namespace std;
int minx = -1000000001, maxx = 1000000001, x, n;
string s, b;
int main() {
  cin >> n;
  while (n--) {
    cin >> s >> x >> b;
    if ((s == ">=" && b == "Y") || (s == "<" && b == "N"))
      minx = max(minx, x);
    else if ((s == ">" && b == "Y") || (s == "<=" && b == "N"))
      minx = max(minx, x + 1);
    else if ((s == "<=" && b == "Y") || (s == ">" && b == "N"))
      maxx = min(maxx, x);
    else if ((s == "<" && b == "Y") || (s == ">=" && b == "N"))
      maxx = min(maxx, x - 1);
  }
  if (minx > maxx)
    cout << "Impossible" << endl;
  else
    cout << minx << endl;
  return 0;
}
