program snack
    implicit none
    integer(8):: a, b
    integer(8):: gcd

    read*, a, b
    gcd = calc_gcd(a,b)
    print*, a*b/gcd
contains
recursive function calc_gcd(x,y) result(ret)
    integer(8):: x, y, ret

    if (mod(x,y) == 0) then
        ret = y
    else
        ret = calc_gcd(y,mod(x,y))
    end if

end function
end program snack