import sys from collections import * import itertools as it if __name__ == '__main__': n,m = list(map(int,input().split())) map_ = [] for i in range(n): temp = list(input()) map_.append(temp) # vis = [[0 for _ in range(m)] for _ in range(n)] res = 0 a = list(...