Infants integrate firsthand and social experiences to decide when and how to try