A painter is planning to paint a row of three houses, using the colors re, gray, and white. If each house is to be painted a single color, and the painter must use each of the three colors, how many different ways are there of painting the three houses?A. 1B.2C. 3D. 6