## Easy Problem

As we know, gcd(A, B) means the Greatest Common Divisor (GCD) of A and B.

But zy thinks it is so easy to just let you calculate it.
So now your task is to calculate gcd(A, B^B),it is easy right?

Notice: B ^ B means B multiply by himself B times.

Multiply test case, each case per line.
Each line 2 integers A, B, 1 <= A, B <= 1000

For each test case output one line( one number ), indicating the value of gcd (A, B^B)

100 1
100 2

1
4


1534

number theory

zy