Solved UVa 102.