Types: n: int  
Ranges: 1 ≤ n ≤ 30  
Addtl Info: No more than 30 datasets, end of input indicated by a single zero line