$n$ points are marked on a plane. Each pair of these points is connected with a segment. Each segment is painted one of four different colors. Find the largest possible value of $n$ such that one can paint the segments so that for any four points there are four segments (connecting these four points) of four different colors. (E. Barabanov)