Tradeoffs for locomotion in air and water