Types: n: int, pm: List[int], pe: List[int], pj: List[int]
Ranges: 1 ≤ n ≤ 10000, 0 ≤ pm[i] ≤ 100, 0 ≤ pe[i] ≤ 100, 0 ≤ pj[i] ≤ 100
Addtl Info: There are no more than 1000 datasets, end of input is indicated by a single line with a zero