A person has three different bags and four different books. The number of ways, in which he can put these books in the bags so that no bag is empty, is:
\( 18 \)
\( 36 \)
\( 39 \)
\( 72 \)