When a number leaves the same remainder when dividing several numbers, the divisor must be a factor of the differences between those numbers. Find the HCF of the differences: |674-500|=174, |790-674|=116, |790-500|=290. HCF(174, 116, 290) = 58, since 174=6×29, 116=4×29, 290=10×29, and HCF=2×29=58.