Pakistan captain Babar Azam and Fawad Alam put on an unbeaten century stand to rescue the hosts from early trouble and lead them to 145 for three at the close of a rain-shortened first day of the second Test with South Africa in Rawalpindi on Thursday.