UVA online judge 103 - Stacking Boxes finished