Adams Inequalities with Exact Growth Condition on Rn and the Heisenberg Group