A factory has two machines, Machine A and Machine B, working together to produce widgets. Machine A can produce 15 widgets per hour, while Machine B can produce 10 widgets per hour. If the factory needs to produce 500 widgets in total, how many hours will it take for both machines working together to complete the job? Let's think step by step and output the final answer within \boxed{}.
user