#include <bits/stdc++.h>
int main(void) {
  int n;
  while (std::cin >> n) {
    int min, max;
    bool minset = false, maxset = false;
    for (int j = 0; j < n; j++) {
      int i;
      std::string a;
      char b;
      std::cin >> a >> i >> b;
      int status;
      if (a == ">=") {
        if (b == 'N')
          status = 4;
        else
          status = 1;
      }
      if (a == ">") {
        if (b == 'N')
          status = 3;
        else
          status = 2;
      }
      if (a == "<=") {
        if (b == 'N')
          status = 2;
        else
          status = 3;
      }
      if (a == "<") {
        if (b == 'N')
          status = 1;
        else
          status = 4;
      }
      if (status == 1) {
        if (minset == false) {
          min = i;
          minset = true;
        } else
          min = std::max(i, min);
      }
      if (status == 2) {
        if (minset == false) {
          min = i + 1;
          minset = true;
        } else
          min = std::max(i + 1, min);
      }
      if (status == 3) {
        if (maxset == false) {
          max = i;
          maxset = true;
        } else
          max = std::min(max, i);
      }
      if (status == 4) {
        if (maxset == false) {
          max = i - 1;
          maxset = true;
        } else
          max = std::min(max, i - 1);
      }
    }
    if (min > max && minset == true && maxset == true)
      std::cout << "Impossible\n";
    else if (minset == false)
      std::cout << max << '\n';
    else
      std::cout << min << '\n';
  }
}
