  Several sages wearing colored hats occupy the vertices of a graph. Each sage
tries to guess the color of his own hat merely on the basis of observing the
hats of his neighbours without exchanging any information. Each hat can have
one of three colors. A predetermined guessing strategy is winning if it
guarantees at least one correct individual guess for every assignment of
colors. We completely solve the problem of describing graphs for which the
sages win.
