If he is only buying one of each, then his total cost from each store would be:
John's: $23.89 + $15.67 + $9.99 = $49.55
Sam's: $21.35 + $12.45 + $12.99 = $46.79
So, Sam's has the better deal (proof above).
If he has 3 twenty dollar bills, then he has $60.
His change would be:
$60 - $46.79 = $13.21
If he bought two pants from Sam's (the store with the better deal), then his total would be:
(2)($21.35) + $12.45 + $12.99 = $68.14