#include <bits/stdc++.h>
using namespace std;
void op(string &s1, char c1) {
  if (s1.size() < 2)
    if (s1[0] == '>')
      s1 = "<=";
    else
      s1 = ">=";
  else if (s1[0] == '>')
    s1 = "<";
  else
    s1 = ">";
}
int main() {
  string s;
  vector<string> v1;
  vector<int> v2;
  bool big = true, pos = true;
  int t, o, n, ans;
  char c;
  cin >> n;
  cin >> s >> t >> c;
  if (c == 'N') op(s, c);
  if (s[0] == '<') big = false;
  if (s.size() > 1)
    ans = t;
  else if (big)
    ans = t + 1;
  else
    ans = t - 1;
  if (big)
    for (int i = 1; i < n; ++i) {
      cin >> s >> t >> c;
      if (c == 'N') op(s, c);
      if (s[0] == '>') {
        if (t >= ans)
          if (s.size() > 1)
            ans = t;
          else
            ans = t + 1;
      } else {
        v1.push_back(s);
        v2.push_back(t);
      }
    }
  else
    for (int i = 1; i < n; ++i) {
      cin >> s >> t >> c;
      if (c == 'N') op(s, c);
      if (s[0] == '<') {
        if (t <= ans)
          if (s.size() > 1)
            ans = t;
          else
            ans = t - 1;
      } else {
        v1.push_back(s);
        v2.push_back(t);
      }
    }
  if (big) {
    for (int i = 0; i < v1.size(); ++i) {
      if (v1[i].size() > 1 && ans > v2[i])
        pos = false;
      else if (v1[i].size() < 2 && ans >= v2[i])
        pos = false;
    }
  } else {
    for (int i = 0; i < v1.size(); ++i) {
      if (v1[i].size() > 1 && ans < v2[i])
        pos = false;
      else if (v1[i].size() < 2 && ans <= v2[i])
        pos = false;
    }
  }
  if (pos)
    cout << ans;
  else
    cout << "Impossible";
}
