#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d\n", &n);
  int l = -2000000000, r = 2000000000;
  while (n--) {
    int k = 0;
    char ch;
    int sum = 0, z = 1;
    bool ok = 1;
    while ((ch = getchar()) != '\n') {
      if (ch == ' ') continue;
      if (ch == '>')
        k = 1;
      else if (ch == '<')
        k = 2;
      else if (ch == '=')
        k = k * 10;
      else if (ch == '-')
        z = -1;
      else if (ch >= '0' && ch <= '9')
        sum = sum * 10 + ch - '0';
      else if (ch == 'N')
        ok = 0;
    }
    sum *= z;
    if (k == 1) {
      if (ok && l < sum + 1)
        l = sum + 1;
      else if (!ok && r > sum)
        r = sum;
    } else if (k == 2) {
      if (ok && r > sum - 1)
        r = sum - 1;
      else if (!ok && l < sum)
        l = sum;
    } else if (k == 10) {
      if (ok && l < sum)
        l = sum;
      else if (!ok && r > sum - 1)
        r = sum - 1;
    } else if (k == 20) {
      if (ok && r > sum)
        r = sum;
      else if (!ok && l < sum + 1)
        l = sum + 1;
    }
    if (l > r) {
      printf("Impossible\n");
      return 0;
    }
  }
  printf("%d\n", r);
  return 0;
}
