#P7541. [2017年杭电多校]Jacana Number

[2017年杭电多校]Jacana Number

Jacana Number

Problem Description

This problem is very simple problem. We define J(n,k) like this:

  1. J(n,1)=n
  2. J(n,k)=nJ(n,k1)n^{J(n,k-1)} (k=2,3,¡­) We call this number ¡°Jacana Number¡±. In this problem you are given two jacana numbers and you must output which Jacana Number is greater than the other.

Input

The first line contains an integer T (1 <= T <= 10000), the number of test cases. Each test case contains four integers n, a, m, b (1 <= n, a, m, b <= 10910^9)

Output

For each test case output one of (‘>’, ‘=’, ‘<’) in one line.

If J(n,a)> J(m,b), output ‘>’.

If J(n,a)= J(m,b), output ‘=’.

If J(n,a)< J(m,b), output ‘<’.

Sample Input

3

2 2 3 1

2 3 3 2

1 2 1 4

Sample Output

>

<

=

Source

2017 Multi-University Training Contest - Team 10

https://acm.hdu.edu.cn/showproblem.php?pid=6177