Find S Algorithm Using Python To Automate