2. Giovanni wants to repaint, each with a single color, the 5 walls of his room (4 vertical walls plus the ceiling). Having red, yellow, and blue paint available (which cannot be mixed), he wants to ensure that adjacent walls (including the ceiling) never have the same color. In how many ways can Giovanni choose to paint the room?
(A) 18
(B) 4
(C) 12
(D)
(E) 6
Problem 2. The answer is (E).

Once the ceiling color is chosen (in 3 possible ways), Giovanni has 2 other colors to choose from for the first wall, while the color of the two adjacent vertical walls must necessarily be the third unused color; finally, the color of the last wall, opposite the first, is consequently determined (it is the only color different from the one used for the ceiling and the two adjacent ones): Giovanni therefore has $3 \cdot 2=6$ possible choices. 

(Problem proposed by F. Poloni)