Pipe P can fill an empty tank in 4 hours but pipe Q can completely empty the same tank in 8 hours. Both the pipes were opened alternately after every two hours stating with pipe P then in how many hours, the tank was completely filled?