A painter can paint a fence in 12 hours working alone. His apprentice who works slower can paint the same fence in 24 hours. How many hours would it take to do the job if they worked together?

8 hours