Each face of a cube is painted one of three colors: red, blue, or green. The color of each face is determined independently, with each color having a probability of . What is the probability that the painted cube can be placed on a horizontal surface so that the four vertical faces are all the same color?