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 JAVA):

Solution:
import java.awt.Point;
import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

import static java.lang.Math.*;

public class Main {

    final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException {
        if (ONLINE_JUDGE) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    public static void main(String[] args) {
        new Main().run();
        // Sworn to fight and die
    }

    public static void mergeSort(int[] a) {
        mergeSort(a, 0, a.length - 1);
    }

    private static void mergeSort(int[] a, int levtIndex, int rightIndex) {
        final int MAGIC_VALUE = 50;
        if (levtIndex < rightIndex) {
            if (rightIndex - levtIndex <= MAGIC_VALUE) {
                insertionSort(a, levtIndex, rightIndex);
            } else {
                int middleIndex = (levtIndex + rightIndex) / 2;
                mergeSort(a, levtIndex, middleIndex);
                mergeSort(a, middleIndex + 1, rightIndex);
                merge(a, levtIndex, middleIndex, rightIndex);
            }
        }
    }

    private static void merge(int[] a, int levtIndex, int middleIndex,
            int rightIndex) {
        int length1 = middleIndex - levtIndex + 1;
        int length2 = rightIndex - middleIndex;
        int[] levtArray = new int[length1];
        int[] rightArray = new int[length2];
        System.arraycopy(a, levtIndex, levtArray, 0, length1);
        System.arraycopy(a, middleIndex + 1, rightArray, 0, length2);
        for (int k = levtIndex, i = 0, j = 0; k <= rightIndex; k++) {
            if (i == length1) {
                a[k] = rightArray[j++];
            } else if (j == length2) {
                a[k] = levtArray[i++];
            } else {
                a[k] = levtArray[i] <= rightArray[j] ? levtArray[i++]
                        : rightArray[j++];
            }
        }
    }

    private static void insertionSort(int[] a, int levtIndex, int rightIndex) {
        for (int i = levtIndex + 1; i <= rightIndex; i++) {
            int current = a[i];
            int j = i - 1;
            while (j >= levtIndex && a[j] > current) {
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = current;
        }
    }

    public void run() {
        try {
            long t1 = System.currentTimeMillis();
            init();
            solve();
            out.close();
            long t2 = System.currentTimeMillis();
            System.err.println("Time = " + (t2 - t1));
        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }

    class LOL implements Comparable<LOL> {
        int x;
        int y;
        int num;

        public LOL(int x, int y, int num) {
            this.x = x;
            this.y = y;
            this.num = num;
        }

        @Override
        public int compareTo(LOL o) {

            if (x == o.x)
                return y - o.y;
            return x - o.x; // ---->
            // return o.x - x; // <----
            // return o.y-y;
        }

    }

//    public void solve() throws IOException {
//
//        int n = readInt();
//        
//         
//        
//        long maxi = 1*1000*1000*1000; 
//        long mini = -1*1000*1000*1000;
//        
//        for (int i = 0; i < n; i++) {
//            String s = readString();
//            int k = readInt();
//            String a = readString();
//            
//            
//            if (a.charAt(0) == 'N'){
//              if (s.charAt(0) == '<'){
//                  if (s.length()==2){
//                      s = ">";
//                  }
//                  else {
//                      s = ">=";
//                  }
//                              
//              }
//              else {
//                  if (s.length()==2){
//                      s = "<";
//                  }
//                  else 
//                      s = "<=";
//              }
//            }
//            
//            if (s.length() == 1){
//              if (s.charAt(0)=='>'){
//                  k++;
//              }
//              else k--;
//            }
//            
//            if (s.charAt(0) == '>'){
//              mini = Math.max(mini,k);
//            }
//            else {
//              maxi = Math.min(maxi,k);
//            }
//            
//        }
//        
//        if (mini < -1*1000*1000*1000){
//            out.print("Impossible");
//            return;
//        }
//        
//        if (mini > 1000*1000*1000){
//            out.print("Impossible");
//            return;
//        }
//        
//        if (mini <= maxi){
//            out.print(mini);
//        }
//        else {
//            out.print("Impossible");
//        }
//
//    }
    

    public void solve() throws IOException {

        int n = readInt();
        
         
        
        long maxi = 2*1000*1000*1000; 
        long mini = -2*1000*1000*1000;
        
        for (int i = 0; i < n; i++) {
            String s = readString();
            int k = readInt();
            String a = readString();
            
            
            
            if (s.length() == 2 && s.charAt(0)=='>' && a.charAt(0)=='Y')
            {   
                mini = Math.max(mini, k);
            }
            
            if (s.length() == 2 && s.charAt(0)=='<' && a.charAt(0)=='Y')
            {   
                maxi = Math.min(maxi, k);
            }
            
            if (s.length() == 1 && s.charAt(0)=='>' && a.charAt(0)=='Y')
            {   
                mini = Math.max(mini, k+1);
            }
            
            if (s.length() == 1 && s.charAt(0)=='<' && a.charAt(0)=='Y')
            {   
                maxi = Math.min(maxi, k-1);
            }
            //-----------------
            
            if (s.length() == 2 && s.charAt(0)=='>' && a.charAt(0)=='N')
            {   
                maxi = Math.min(maxi, k-1);
            }
            
            if (s.length() == 2 && s.charAt(0)=='<' && a.charAt(0)=='N')
            {   
                mini = Math.max(mini,k+1);
            }
            
            if (s.length() == 1 && s.charAt(0)=='>' && a.charAt(0)=='N')
            {   
                maxi = Math.min(maxi, k);
            }
            
            if (s.length() == 1 && s.charAt(0)=='<' && a.charAt(0)=='N')
            {   
                mini = Math.max(mini, k);
            }
            
        }
        
        if (mini < -2*1000*1000*1000){
            out.print("Impossible");
            return;
        }
        
        if (mini > 2*1000*1000*1000){
            out.print("Impossible");
            return;
        }
        
        if (mini <= maxi){
            out.print(maxi);
        }
        else {
            out.print("Impossible");
        }

    }

}