find GCD of three numbers in java