#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int x;
  int mx = 2 * 1000 * 1000 * 1000, mn = -mx;
  string s, ans;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s >> x >> ans;
    if (ans == "N") {
      if (s == ">=")
        s = "<";
      else if (s == "<")
        s = ">=";
      else if (s == "<=")
        s = ">";
      else
        s = "<=";
    }
    if (s == ">=") {
      mn = max(mn, x);
    } else if (s == ">") {
      mn = max(mn, x + 1);
    } else if (s == "<=") {
      mx = min(mx, x);
    } else {
      mx = min(mx, x - 1);
    }
  }
  if (mn <= mx)
    cout << mn << endl;
  else
    cout << "Impossible\n";
  return 0;
}
