#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const double eps = 1e-8;
const int maxn = 30000;
const int mod = 1000000000 + 7;
char a[10], b[10];
int c;
int main() {
  int T;
  cin >> T;
  int Min = -2 * INF;
  int Max = 2 * INF;
  int flag = 1;
  while (T--) {
    scanf("%s%d%s", a, &c, b);
    int len = strlen(a);
    if (len == 2) {
      if (a[0] == '>') {
        if (b[0] == 'Y') {
          if (c > Max)
            flag = 0;
          else
            Min = max(Min, c);
        } else {
          if (c <= Min)
            flag = 0;
          else
            Max = min(Max, c - 1);
        }
      } else {
        if (b[0] == 'Y') {
          if (c < Min)
            flag = 0;
          else
            Max = min(Max, c);
        } else {
          if (c >= Max)
            flag = 0;
          else
            Min = max(Min, c + 1);
        }
      }
    } else {
      if (a[0] == '>') {
        if (b[0] == 'Y') {
          if (c >= Max)
            flag = 0;
          else
            Min = max(Min, c + 1);
        } else {
          if (c < Min)
            flag = 0;
          else
            Max = min(c, Max);
        }
      } else {
        if (b[0] == 'Y') {
          if (c <= Min)
            flag = 0;
          else
            Max = min(Max, c - 1);
        } else {
          if (c > Max)
            flag = 0;
          else
            Min = max(c, Min);
        }
      }
    }
  }
  if (flag == 0)
    cout << "Impossible" << endl;
  else
    cout << Min << endl;
  return 0;
}
