import copy total = int(input()) for k in range(total): res=0 W,H = map(int,input().split()) background = [] for r in range(H): background.append([char for char in input()]) temp = copy.deepcopy(background) P,Q = map(int,input().split()) character = [] for r in range(Q): character.append...