Divisor Set Inclusion

No attempts yetTime limit1sMemory limit128 MB

Problem

You are given two integers aa and bb. Determine whether the set of divisors of aa is contained in the set of divisors of bb.

Input

The first line contains a single integer zz (1z1061 \le z \le 10^6), the number of data sets. Each of the next zz lines describes one data set and contains two integers aa, bb (1a,b1091 \le a, b \le 10^9) separated by a space.

Output

Print zz lines. Each line contains the answer for one data set. If the set of divisors of aa is contained in the set of divisors of bb, print TAK; otherwise print NIE.