Types: n: int  
Ranges: 1 ≤ n ≤ 30  
Addtl Info: No more than 30 datasets, input ends with a single zero line