UVa10557 accepted