Generalized Fermat equations with three distinct prime exponents