uses
crt;
var
divv, m, n: integer;
P, Q: real;
function gcd(m, n: integer): integer;
var
modulo: integer;
begin
modulo := m mod n;
if modulo = 0 then
gcd := n
else
gcd := gcd(n, modulo)
end;
begin
write('Enter two numbers: ');
readln(n, m);
divv := gcd(n, m);
P := m / divv;
Q := n / divv;
writeln(P:0:0, ' ', Q:0:0);
readln;
end.