Self-propulsion of general deformable shapes in a perfect fluid