#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, w;
  t = -1000000005;
  w = -t;
  int q, n;
  cin >> q;
  int i;
  string bnm;
  char ew;
  for (i = 1; i <= q; i++) {
    cin >> bnm;
    cin >> n;
    cin >> ew;
    if (ew == 'N') {
      if (bnm.size() == 2)
        bnm = '<' + '>' - bnm[0];
      else
        bnm = '<' + '>' - bnm[0], bnm += '=';
    }
    if (bnm.size() == 1) n += (bnm[0] == '<' ? -1 : 1);
    if (bnm[0] == '<')
      w = min(w, n);
    else
      t = max(t, n);
  }
  if (t > w)
    cout << "Impossible" << endl;
  else {
    cout << w << endl;
  }
  return 0;
}
