things that come to mind that he could talk about.
While 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).
Adhering to largest numbers that divide both
and
?
Constraints
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