import sys input = sys.stdin.readline for _ in range(int(input())): x = input()[:-1] y = input()[:-1] if len(x)