UVa 162: not finished