In a factory, there are three machines, A, B, and C, working together to produce widgets. Machine A can produce 30 widgets per hour, machine B can produce 40 widgets per hour, and machine C can produce 50 widgets per hour. If the factory needs to produce a total of 600 widgets, how many hours will it take for all three machines working together to complete the job? Let's think step by step and output the final answer within \boxed{}.
user