Solve UVa 11472 - Beautiful Numbers.