In dividing a number by 585, a student employed the method of short division. He divided the number successively by 5, 9 and 13 (factors of 585) and got the remainders 4, 8, 12 respectively. If he had divided the number by 585, the remainder would have been _____.
(A) 24
(B) 144
(C) 292
(D) 584