URAL 1716 Alternative Solution