#include <bits/stdc++.h>
using namespace std;
string fu;
int fuu;
int num;
char an;
int lp = -2000000000;
int rp = 2000000000;
int main() {
  int n;
  cin >> n;
  while (n--) {
    cin >> fu >> num >> an;
    if (fu == ">=") fuu = 1;
    if (fu == ">") fuu = 2;
    if (fu == "<=") fuu = 3;
    if (fu == "<") fuu = 4;
    if (an == 'N') {
      if (fuu == 1)
        fuu = 4;
      else if (fuu == 2)
        fuu = 3;
      else if (fuu == 3)
        fuu = 2;
      else if (fuu == 4)
        fuu = 1;
    }
    switch (fuu) {
      case 1:
        if (num >= lp) lp = num;
        break;
      case 2:
        if (num + 1 >= lp) lp = num + 1;
        break;
      case 3:
        if (num <= rp) rp = num;
        break;
      case 4:
        if (num - 1 <= rp) rp = num - 1;
        break;
    }
  }
  if (lp <= rp)
    cout << lp << endl;
  else
    cout << "Impossible" << endl;
  return 0;
}
