import java.util.Scanner; import java.util.ArrayDeque; import java.util.function.LongUnaryOperator; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int Q = sc.nextInt(); long Y = sc.nextLong(); ArrayDeque deq = new ArrayDeque<>(); while(Q-->0){ String S = sc.next(); if(S.equals("+")){ LongUnaryOperator f1 = deq.pollLast(); LongUnaryOperator f2 = deq.pollLast(); LongUnaryOperator f = x -> f1.applyAsLong(x)+f2.applyAsLong(x); deq.add(f); } else if(S.equals("min")){ LongUnaryOperator f1 = deq.pollLast(); LongUnaryOperator f2 = deq.pollLast(); LongUnaryOperator f = x -> Math.min(f1.applyAsLong(x),f2.applyAsLong(x)); deq.add(f); } else if(S.equals("max")){ LongUnaryOperator f1 = deq.pollLast(); LongUnaryOperator f2 = deq.pollLast(); LongUnaryOperator f = x -> Math.max(f1.applyAsLong(x),f2.applyAsLong(x)); deq.add(f); } else if(S.equals("X")){ LongUnaryOperator f = X -> X; deq.add(f); } else{ long num = Long.parseLong(S); LongUnaryOperator f = X -> num; deq.add(f); } } LongUnaryOperator f = deq.pollFirst(); long a = 0; long b = 10_000_000_000_001L; long inf = b; long ans = b; while(a-b<1){ long c = a+b>>1; if(f.applyAsLong(c)