Help the Librarian!
The Library has just bought 3 identical Math Books, 3 identical Literature Books, 3 identical Science Books and 3 identical Novels.
The Librarian wants to arrange the books in the shelf so that, no 3 identical books stand in a row.
For example, he can arrange MMLLSSNNMLSN but he can't arrange SSMMMLLNNSLN.
In how many different ways can the Librarian arrange the books?