Sapphire and Abe are shelving books at a public library. Sapphire shelves 12 books at a time, whereas Abe shelves 18 at a time. If they end up shelving the same number of books, what is the smallest number of books each could have shelved.