Working alone at their respective constant rates, machine A and machine B can fill a certain order in 3 hours and 6 hours, respectively. If the two machines work simultaneously at their respective constant rates, how many hours does it take the two machines to fill?