#include <bits/stdc++.h>
using namespace std;
int main() {
  int mi = -2000000000;
  int ma = 2000000000;
  vector<int> v;
  vector<pair<int, int> > p;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) p.push_back(make_pair(mi, ma));
  string arr[n], ar[n];
  int i, a[n];
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    cin >> a[i];
    cin >> ar[i];
    if (arr[i] == "<=" && ar[i] == "Y")
      p[i].second = a[i];
    else if (arr[i] == "<=" && ar[i] == "N")
      p[i].first = a[i] + 1;
    else if (arr[i] == "<" && ar[i] == "Y")
      p[i].second = a[i] - 1;
    else if (arr[i] == "<" && ar[i] == "N")
      p[i].first = a[i];
    else if (arr[i] == ">=" && ar[i] == "Y")
      p[i].first = a[i];
    else if (arr[i] == ">=" && ar[i] == "N")
      p[i].second = a[i] - 1;
    else if (arr[i] == ">" && ar[i] == "Y")
      p[i].first = a[i] + 1;
    else if (arr[i] == ">" && ar[i] == "N")
      p[i].second = a[i];
  }
  sort(p.begin(), p.end());
  int k = p[p.size() - 1].first;
  for (i = 0; i < p.size(); i++) v.push_back(p[i].second);
  sort(v.begin(), v.end());
  int t = v[0];
  if (t >= k)
    cout << k;
  else
    cout << "Impossible";
  return 0;
}
