Find S Algorithm Program In Python