UVa1647 accepted.