Solution for UVa-10099