Sharp Moser-Trudinger and Adams type inequalities