In the lower left corner of the board M×N is the queen. Two players take turns walking the queen, moving it to any number of cells vertically upwards, horizontally to the right, or diagonally to the right and upwards.
The winner is the one who put the queen in the top right corner of the board. Determine which of the players has a winning strategy.
The input to the program of fed two natural numbers M and N, not exceeding 100.
The program should print player number (1 or 2) who has a winning strategy.