#include <bits/stdc++.h>
using namespace std;
long long minn = (-2 * int(1e9)), maxx = (2 * int(1e9)), a, n;
string s;
vector<long long> greater_, smaller;
char c;
int main() {
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s >> a >> c;
    if (c == 'N') {
      if (s[0] == '>') {
        s[0] = '<';
      } else {
        s[0] = '>';
      }
      if (s.size() < 2) {
        s += '=';
      } else {
        s.erase(s.end() - 1);
      }
    }
    if (s[0] == '>') {
      greater_.push_back(a - (s[1] == '='));
    } else {
      smaller.push_back(a + (s[1] == '='));
    }
  }
  greater_.push_back(minn), smaller.push_back(maxx);
  sort(greater_.begin(), greater_.end());
  sort(smaller.begin(), smaller.end());
  minn = max(greater_.back() + 1, minn);
  maxx = min(smaller.front() - 1, maxx);
  while (minn <= maxx) {
    return cout << minn << endl, 0;
    minn++;
  }
  cout << "Impossible\n";
  return 0;
}
