Bus A and Bus B leave the bus depot at 5 pm. Bus A takes 30 minutes to do its route and bus B takes 35 minutes to complete its route. At what time are they both back at the bus depot together? Give your answer as a 12-hour clock time.