Dynamic teamwork in relay swimming