things that come to mind that he could talk about.
is trying to come up with a pickup line for his valentine, but is having trouble deciding on what to talk about! He could be generic, but there's no way that works, and he could talk about the little things, but then it might seem like he's too interested! Thus, tells him to write down the firstWhile there may be no way to model as everything is interested in, and the integer as everything his valentine is interested in. Factors of both and represent things that both and his valentine are interested in. The things that wrote down can be represented as the largest of these factors (the more generic, the higher the corresponding number).
's brain in code, let's denote the integerAdhering to largest numbers that divide both and ?
's advice, can you find theConstraints
Subtask 1 [40%]
Subtask 2 [60%]
Input Specification
The first and only line of input contains , , and .
Output Specification
Output on a single line the largest numbers that divide both and , ordered from least to greatest. If there are less than factors that divide and , output all the factors, again from least to greatest.
Sample Input 1
24 18 4
Sample Output 1
1 2 3 6
Sample Input 2
25 100 5
Sample Output 2
1 5 25
Comments