Changed to reflect the new version of the problem statement.