Christmas is still far and Santa decided to take a short vacation. If you think that he went to the sea to sunbathe, you are mistaken. Accustomed to frost and cold, the Christmas grandfather set off on foot to the mountains along the most impassable paths, or rather, to those where there are no roads at all. Do not think that Santa is completely crazy, he just has a means to pass through any obstacles and it is called a magic wand. If you think that this is the wand that can fulfill any desire, this is not entirely true. Santa's stick can turn into a bridge, stretching to any distance. Your task is to correctly determine the length of the stick so that it overlaps the empty spaces.