Pakistan Test captain Shan Masood changed the record books with his individual brilliance and a memorable opening stand with his predecessor Babar Azam on Day 3 of the second Test against South Africa.