#include <bits/stdc++.h>
using namespace std;
int m = -2000000000, n = 2000000000;
int main() {
  char useless[100];
  int t;
  cin >> t;
  getchar();
  while (t--) {
    char a, c;
    int k;
    char o;
    bool flag = true;
    scanf("%c%c", &a, &c);
    if (c == '=') flag = false;
    scanf("%d", &k);
    scanf("%c%c", &o, &o);
    gets(useless);
    if (o == 'Y') {
      if (a == '>')
        m = max(m, k + flag);
      else
        n = min(n, k - flag);
    } else {
      flag = !flag;
      if (a == '<')
        m = max(m, k + flag);
      else
        n = min(n, k - flag);
    }
  }
  if (m > n)
    cout << "Impossible";
  else
    cout << m;
  return 0;
}
