To ensure no bag is empty, exactly one bag must contain 2 books and the other two bags must contain 1 book each.
The number of ways to choose 2 books out of 4 to be kept together is 4C2=6
Now, we have 3 units (one pair of books and two single books) to be distributed into the 3 different bags.
The number of ways to distribute these 3 units into 3 bags is 3!=6
Total number of ways = 6×6=36
Answer: 36