A tank of 425 litres capacity has been filled with water through two pipes, the first pipe having been opened five hours longer than the second. If the first pipe were open for as long as second, and the second pipe was open as long as the first pipe was open, then the first pipe would deliver half the amount of water delivered by the second pipe; if the two pipes were open simultaneously, the tank would be filled up in 17 hours. How long was the second pipe open?