One night Mr.X and Mr.Y were playing a game. To test Mr.Y's intelligence Mr.X gives him an interesting problem to solve.
He gives him a number N and asks him to
swap the digits in the number such that a smallest number M is obtained without leading zeroes. Mr.Y thinks this is an easy problem to solve and immediately gives the answer.
The number can be large therefore Mr.X wants to check Mr.Y's answer by writing a program for this problem.
Since Mr.X is not so good in programming therefore he asks for your help in doing so.
 

Input

The first line of input contains T, the number of test cases.
The first line of each test case contains one integer N without leading zeroes.
The second line will contain one integer M — Mr.Y's answer.

 

Output

For each test case output "AC" if Mr.Y's answer is correct, otherwise "WA" (without quotes).

 

Constraints
Should contain all the constraints on the input data that you may have. Format it like:

1 ≤ T ≤ 100
1 ≤ N ≤ 10^9
1 ≤ M ≤ 10^9

 

Example
Input:
2
310
103
1
2

Output:
AC
WA
 

Explanation
Self Explanatory
for a in range(input()):
    ins = sorted(val for val in raw_input())
    if ins[0]=="0":
        for x in range(1,len(ins)):
            if int(ins[x])>0:
                ins[0] = ins[x]
                ins[x] = "0"
                break
            
    if "".join(ins) == raw_input():
        print "AC"
    else:
        print "WA"