A newborn infant is found to have bilateral undescended testes and ambiguous genitalia.What is the most important initial investigation?