Types: n: int, ai: 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.