Exponentiation
시간 제한3초메모리 제한1024 MB
모든 변수가 2023으로 시작하고 다른 변수를 지수로 하는 거듭제곱으로 갱신될 때, 실제 값을 계산하지 않고 두 변수의 대소를 판정한다.
문제
In her spare time, Zoe develops an online calculator. Unfortunately, the calculator was targeted by a denial-of-service attack last week. The attacker created a lot of integer variables, exponentiated them with each other, and tried to do a bunch of comparisons. The huge integers were too much for the server to handle, so it crashed. Before Zoe fixes the issue, she decides to actually perform the calculations that the attacker requested.
There are integer variables . At the start, each variable is set to . You have to perform instructions of the following two types:
- Operations, of the form "
!", where . This means that gets set to . - Queries, of the form "
?", where . This means that you should print '>' if is greater than , '=' if is equal to , and '<' if is smaller than .
Consider the first sample. After the operations, the values of the variables are: \begin{align\*} x\_1&=\left({2023}^{2023}\right)^{{2023}^{2023}},& x\_2&=\left({2023}^{{2023}^{2023}}\right)^{2023},& x\_3&={2023},& x\_4&={2023}^{2023}. \end{align\*}
입력
The input consists of:
- One line with two integers and (, ), the number of variables and the number of instructions.
- lines, each containing a character (either '
!' or '?') and two integers and (, ), describing the instructions.
출력
For every query in the input, output its answer.