Adaptation to multiple environments