A hospital gift shop sells magazines, books and cards in the ratio 4:3:9. Suppose the shop sold 45 books, how many magazines and how many cards did they sell.