Jimmy has reached the last floor of the maze. Two doors stand there. One leads to the treasure repository, the other opens the gate to hell. Opening the wrong door ends the game and erases his save data, so he must never pick it.
Each door carries one positive integer, and that number is the only hint. The door whose number has the larger key number leads to the treasure repository. The key number of a positive integer n is the largest distinct prime factor of n minus the sum of the remaining distinct prime factors. A prime factor is counted once even if it divides n several times.
For example, suppose the two doors carry 30 and 20. The prime factors of 30 are 2, 3, 5, so its key number is 5−(2+3)=0. The prime factors of 20 are 2 and 5, so its key number is 5−2=3. Jimmy must open the door marked 20.
Write a program that reads the two numbers and decides which door to open.