#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, num;
  int mn = -2000000000;
  int mx = 2000000000;
  cin >> n;
  string s, ans, ss;
  while (n--) {
    cin >> s;
    cin >> num;
    cin >> ans;
    if (ans == "N") {
      if (s == ">=")
        s = "<";
      else if (s == "<")
        s = ">=";
      else if (s == "<=")
        s = ">";
      else
        s = "<=";
    }
    if (s == ">")
      mn = max(mn, num + 1);
    else if (s == ">=")
      mn = max(mn, num);
    else if (s == "<=")
      mx = min(mx, num);
    else
      mx = min(mx, num - 1);
  }
  if (mn <= mx)
    cout << mn << endl;
  else
    cout << "Impossible" << endl;
  return 0;
}
