Solutions of the second and fourth Painlevé equations, I