Given a piece of graph paper with a letter assigned to each vertex of every square such that on every segment connecting two vertices that have the same letter and are on the same line of the mesh, there is at least one vertex with another letter. What is the least number of distinct letters needed to plot such a picture, along the sides of the cells?