Solved UVa 123