Time limit: 2.0s
Memory limit: 256M
Counting is very difficult so Veshy asks you for help. You are given two positive integers, and . You want to find the highest power of , , that will divide into . In other words, you want to find the maximum such that divides into .
The input is a single line containing two space-separated integers, and in that order.
Output on a single line, the number such that divides into and is the greatest possible.
Sample Input 1
Sample Output 1
Sample Input 2
Sample Output 2
In sample input 1, is the highest power of that can divide into .
In sample input 2, is the highest power of that can divide into .