Problem: A TV show called "Guess a number!" is gathering popularity. The whole Berland, the old and the young, are watching the show.

The rules are simple. The host thinks of an integer y and the participants guess it by asking questions to the host. There are four types of acceptable questions:

  * Is it true that y is strictly larger than number x? 
  * Is it true that y is strictly smaller than number x? 
  * Is it true that y is larger than or equal to number x? 
  * Is it true that y is smaller than or equal to number x? 



On each question the host answers truthfully, "yes" or "no".

Given the sequence of questions and answers, find any integer value of y that meets the criteria of all answers. If there isn't such value, print "Impossible".

Input

The first line of the input contains a single integer n (1 ≤ n ≤ 10000) — the number of questions (and answers). Next n lines each contain one question and one answer to it. The format of each line is like that: "sign x answer", where the sign is:

  * ">" (for the first type queries), 
  * "<" (for the second type queries), 
  * ">=" (for the third type queries), 
  * "<=" (for the fourth type queries). 



All values of x are integer and meet the inequation  - 109 ≤ x ≤ 109. The answer is an English letter "Y" (for "yes") or "N" (for "no").

Consequtive elements in lines are separated by a single space.

Output

Print any of such integers y, that the answers to all the queries are correct. The printed number y must meet the inequation  - 2·109 ≤ y ≤ 2·109. If there are many answers, print any of them. If such value doesn't exist, print word "Impossible" (without the quotes).

Examples

Input

4
&gt;= 1 Y
&lt; 3 N
&lt;= -3 N
&gt; 55 N


Output

17


Input

2
&gt; 100 Y
&lt; -100 Y


Output

Impossible

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 5;
const int M = (int)1e9;
bool mark[N];
int lowbit(int n) { return log2(n & -n) + 1; }
void sieve() {
  memset(mark, true, sizeof(mark));
  mark[0] = 0, mark[1] = 0, mark[2] = 1;
  for (int i = 4; i <= N; i += 2) {
    mark[i] = 0;
  }
  for (int i = 3; i * i <= N; i += 2) {
    if (mark[i]) {
      for (int j = i * i; j <= N; j += i) {
        mark[j] = 0;
      }
    }
  }
}
long long gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(int a, int b) { return (a / gcd(a, b)) * b; }
bool is_prime(long long int n) {
  long long int x = sqrt(n);
  bool check = 1;
  for (long long int i = x; i >= 2; i--) {
    if (n % i == 0) {
      check = 0;
      break;
    }
  }
  return check;
}
long long int char_to_num(char *str) {
  long long int num = 0, n = strlen(str), r;
  for (int i = 0; i < n; i++) {
    if (str[i] > 47 && str[i] < 58) {
      if (i == 0) {
        num = (str[i] - 48);
        if (n > 1 && str[i + 1] > 47 && str[i + 1] < 58) {
          num *= 10;
        }
      } else {
        num += (str[i] - 48);
        if (i != n - 1 && str[i + 1] > 47 && str[i + 1] < 58) {
          num *= 10;
        }
      }
    }
  }
  return num;
}
char *num_to_char(long long int num, char *str) {
  long long int r, i = 0, n = num, j;
  while (1) {
    r = n % 10;
    str[i] = (48 + r);
    n /= 10;
    if (n == 0) {
      break;
    }
    i++;
  }
  str[i + 1] = '\0';
  for (i = 0, j = strlen(str) - 1; i < strlen(str) / 2; i++, j--) {
    swap(str[i], str[j]);
  }
  return str;
}
bool perfect_square(long long int val) {
  double s = sqrt(val);
  long long int i = sqrt(val);
  if (s == i) {
    return 1;
  } else {
    return 0;
  }
}
bool desc(int a, int b) { return a > b; }
bool cond(int a, int b) {}
int main() {
  int n, i;
  cin >> n;
  long long int l = -(2 * M), r = 2 * M, x, y;
  bool impossible = 0;
  while (n--) {
    char sign[3], exist;
    bool y = 0;
    long long int val;
    scanf("%s %lld %c", sign, &val, &exist);
    int sign_size = strlen(sign);
    if (exist == 'Y') {
      if (sign_size == 1) {
        if (sign[0] == '>') {
          l = max(l, val + 1);
        } else {
          r = min(r, val - 1);
        }
      } else {
        if (sign[0] == '>') {
          l = max(l, val);
        } else {
          r = min(r, val);
        }
      }
    } else {
      if (sign_size == 1) {
        if (sign[0] == '>') {
          r = min(r, val);
        } else {
          l = max(l, val);
        }
      } else {
        if (sign[0] == '>') {
          r = min(r, val - 1);
        } else {
          l = max(l, val + 1);
        }
      }
    }
    if (l > r) {
      impossible = 1;
    }
  }
  if (impossible) {
    cout << "Impossible" << endl;
  } else {
    cout << l << endl;
  }
  return 0;
}