q = int(input()) for i in range(q): n = int(input()) push = list(map(int, input().strip().split())) pop = list(map(int, input().strip().split())) stack = [] for i in range(n): stack.append(push[i]) while len(stack) > 0 and stack[-1] == pop[0]: stack.pop() del pop[0] if len(stack) == 0: print(&quo...