https://www.acmicpc.net/problem/10026 import sysfrom collections import dequedef Input_Data(): readl = sys.stdin.readline N = int(input()) graph = [list(input()) for _ in range(N)] return N, graph d = ((1,0), (0,1), (-1, 0), (0,-1))def Bfs(i,j,color): q = deque() q.append((i,j)) visited[i][j] = 1 while q: x,y = q.popleft() for dx, dy in d: nx..