three-pipe problems