How the body stays upright on a swaying line