Types: n: int, ai: List[int]
Ranges: 1 ≤ n ≤ 100, 1 ≤ ai ≤ 1000000
Addtl Info: The number of datasets does not exceed 20, the end of the input is indicated by a single zero