#include <bits/stdc++.h>
using namespace std;
int n, INF = 1 << 30;
int main() {
  cin >> n;
  int min_y = -INF, max_y = INF;
  for (int i = 0; i < (int)n; ++i) {
    string s, t;
    int x;
    cin >> s >> x >> t;
    if ((s == ">" && t == "Y") || (s == "<=" && t == "N"))
      min_y = max(min_y, x + 1);
    else if ((s == "<" && t == "Y") || (s == ">=" && t == "N"))
      max_y = min(max_y, x - 1);
    else if ((s == "<=" && t == "Y") || (s == ">" && t == "N"))
      max_y = min(max_y, x);
    else if ((s == ">=" && t == "Y") || (s == "<" && t == "N"))
      min_y = max(min_y, x);
  }
  if (max_y < min_y)
    puts("Impossible");
  else
    cout << min_y << endl;
}
