Pakistan beat South Africa by 66 runs in second ODI