Bangladesh were 127 for three at the close, still trailing by 369 runs after South Africa declared their first innings on 496 for three.