In a book club, there are 5 different mystery novels, 4 different fantasy novels, and 3 different science fiction novels. The club wants to arrange these books on a shelf such that all books of the same genre are grouped together. In how many different ways can the books be arranged on the shelf? Let's think step by step and output the final answer within \boxed{}.
user