#include <bits/stdc++.h>
using namespace std;
long double dis(double x, double y, double x1, double y1) {
  return sqrt((x - x1) * (x - x1) + (y - y1) * (y - y1));
}
double PI = 3.14159265;
double e = 2.718281828;
void EnGz() {
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
}
long long GCD_(long long a, long long b) { return b ? GCD_(b, a % b) : a; }
long long LCM_(long long a, long long b) { return (a * b) / GCD_(a, b); }
void print(vector<long long> v) {
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << endl;
}
int main() {
  EnGz();
  int mn = -2e9, mx = 2e9, n;
  cin >> n;
  string s;
  char ch;
  int q;
  for (int i = 0; i < n; i++) {
    cin >> s >> q >> ch;
    if (s == ">=") {
      if (ch == 'Y')
        mn = max(q, mn);
      else
        mx = min(q - 1, mx);
    } else if (s == "<=") {
      if (ch == 'Y')
        mx = min(mx, q);
      else
        mn = max(mn, q + 1);
    } else if (s == ">") {
      if (ch == 'Y')
        mn = max(mn, q + 1);
      else
        mx = min(q, mx);
    } else {
      if (ch == 'Y')
        mx = min(mx, q - 1);
      else
        mn = max(q, mn);
    }
  }
  if (mn <= mx)
    cout << mn;
  else
    cout << "Impossible";
  return 0;
}
