Theorem 0.6.1 of Roman's book Field Theory says:
Let $R$ be an integral domain for which the factorization property holds (factorization property means that every non zero non unit can be written as a product of irreducibles). The following conditions are equivalent:
1) $R$ is a UFD
2) Every irreducible element of $R$ is prime
3) Any two non-zero elements of $R$ have a greatest common divisor.
I showed that 1) implies 2) and that 2) implies 3), but I don't see why 3) implies 1)
Question: What is the proof that 3) implies 1) ?
Thank you