Chef likes strings a lot but he likes palindromic strings more. Today, Chef has two strings A and B, each consisting of lower case alphabets.

Chef is eager to know whether it is possible to choose some non empty strings s1 and s2 where s1 is a substring of A, s2 is a substring of B such that s1 + s2 is a palindromic string. Here '+' denotes the concatenation between the strings.
Note:
A string is a palindromic string if it can be read same both forward as well as backward. To know more about palindromes click here.

-----Input-----
- First line of input contains a single integer T denoting the number of test cases.
- For each test case:
	
- First line contains the string A
- Second line contains the string B.

-----Output-----
For each test case, Print "Yes" (without quotes) if it possible to choose such strings s1 & s2. Print "No" (without quotes) otherwise.


-----Constraints-----
- 1 ≤ T ≤ 10 
- 1 ≤ |A|, |B| ≤ 1000 

-----Subtasks-----
-  Subtask 1: 1 ≤ |A|, |B| ≤ 10 : ( 40 pts )
-  Subtask 2: 1 ≤ |A|, |B| ≤ 1000 : ( 60 pts )

-----Example-----Input
3
abc
abc
a
b
abba
baab

Output
Yes
No
Yes

-----Explanation-----
- Test 1: One possible way of choosing s1 & s2 is s1 = "ab", s2 = "a" such that s1 + s2 i.e "aba" is a palindrome.
- Test 2: There is no possible way to choose s1 & s2 such that s1 + s2 is a palindrome.
- Test 3: You can figure it out yourself.

Difficulty: EASY

Solutions:
for _ in range(int(input())):
	a = input()
	b = input()
	f = 0
	for i in a:
		for j in b:
			if i == j:
				print('Yes')
				f = 1
				break
		if f == 1:
			break
	if f == 0:
		print('No')


for k in range(int(input())):
	a = input()
	b = input()
	flag = 0
	for i in a:
		for j in b:
			if i == j:
				print('Yes')
				flag = 1
				break
			if flag == 1:
				break
		if flag == 1:
			break
	if flag == 0:
		print('No')


for _ in range(int(input())):
	a = input()
	b = input()
	ans = 'No'
	for i in range(len(a)):
		if a[i] in b:
			ans = 'Yes'
			break
	print(ans)


n = int(input())
for i in range(n):
	a = input()
	b = input()
	c = 0
	for i in a:
		if i in b:
			c = 1
			print('Yes')
			break
	if c == 0:
		print('No')


def main():
	T = int(input())
	for _ in range(T):
		A = input()
		B = input()
		flag = False
		for i in range(len(A)):
			for j in range(len(B)):
				if A[i] == B[j]:
					flag = True
					break
			if flag:
				break
		print('Yes' if flag else 'No')
main()


T = int(input())
for i in range(T):
	A = input()
	B = input()
	flag = 0
	for i in A:
		if i in B:
			flag = 1
			break
	if flag == 0:
		print('No')
	else:
		print('Yes')


tc = int(input())
for _ in range(tc):
	a = input()
	b = input()
	n1 = len(a)
	n2 = len(b)
	gorb = False
	if n1 <= n2:
		for i in a:
			if i in b:
				gorb = True
				break
	else:
		for i in b:
			if i in a:
				gorb = True
				break
	print('Yes' if gorb else 'No')


t = int(input())
for i in range(t):
	a = input()
	b = input()
	c = 0
	for i in a:
		if i in b:
			c = 1
			break
		else:
			continue
	if c == 1:
		print('Yes')
	else:
		print('No')


t = int(input())
for x in range(t):
	a = input()
	b = input()
	flag = False
	for i in a:
		if i in b:
			flag = True
			break
	if flag:
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	a = input()
	b = input()
	s1 = set(a)
	s2 = set(b)
	f = 0
	for i in s1:
		if i in s2:
			print('Yes')
			f = 1
			break
	if f == 0:
		print('No')


t = int(input())
for i in range(t):
	s1 = set(input())
	s2 = set(input())
	count = 0
	for ele in s1:
		if ele in s2:
			count += 1
	if count > 0:
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	str1 = input()
	str2 = input()
	res = 'No'
	for i in str1:
		if i in str2:
			res = 'Yes'
			break
	print(res)


t = int(input())
for i in range(t):
	a = input()
	b = input()
	c = False
	for j in a:
		if j in b:
			c = True
			break
	if c:
		print('Yes')
	else:
		print('No')


import sys

def iinput():
	return int(input())
for _ in range(iinput()):
	s1 = set(input())
	s2 = set(input())
	if len(s1 & s2):
		print('Yes')
	else:
		print('No')


T = int(input())
for i in range(T):
	A = input()
	B = input()
	count = 0
	for j in A:
		if j in B:
			count += 1
	if count > 0:
		print('Yes')
	else:
		print('No')


for i in range(int(input())):
	x = input()
	y = input()
	flag = 0
	for i in range(len(x)):
		for j in range(len(y)):
			if x[i] == y[j]:
				flag = 1
	if flag != 1:
		print('No')
	else:
		print('Yes')


t = int(input())
while t:
	A = input()
	B = input()
	f = False
	for i in A:
		if i in B:
			f = True
			break
	if f == True:
		print('Yes')
	else:
		print('No')
	t = t - 1


for i in range(int(input())):
	a = input()
	b = input()
	for i in a:
		if i in b:
			print('Yes')
			break
	else:
		print('No')


def solve(A, B):
	flag = False
	for i in range(len(A)):
		if A[i] in B:
			flag = True
			print('Yes')
			break
	if flag == False:
		print('No')
for _ in range(int(input())):
	a = input()
	b = input()
	solve(a, b)


for _ in range(int(input())):
	a = set(input())
	b = set(input())
	print('Yes' if len(a & b) > 0 else 'No')


T = int(input())
for cases in range(T):
	A = input()
	B = input()
	duplicate_Strings = [s for s in A if s in B]
	if len(duplicate_Strings) > 0:
		print('Yes')
	else:
		print('No')


x = int(input())
i = []
for mk in range(0, x):
	ik = str(input())
	ire = str(input())
	ytr = [ik, ire]
	i.append(ytr)
for jk in i:
	up = jk[0]
	idx = jk[1]
	loft = 0
	for ip in up:
		if ip in idx:
			print('Yes')
			loft = 1
			break
	if loft != 1:
		print('No')


for t in range(int(input())):
	s1 = set(input())
	s2 = set(input())
	flag = False
	for key in s1:
		if key in s2:
			flag = True
			break
	if flag:
		print('Yes')
	else:
		print('No')


from collections import Counter
t = int(input())
for _ in range(t):
	s1 = input()
	s2 = input()
	j = 1
	f = 0
	for i in range(len(s1)):
		subs = s1[i:j]
		j += 1
		if subs in s2:
			print('Yes')
			f = 1
			break
	if f == 0:
		print('No')


t = int(input())
for i in range(t):
	a = input()
	b = input()
	a = set(a)
	b = set(b)
	c = 0
	for j in a:
		if j in b:
			c += 1
	if c > 0:
		print('Yes')
	else:
		print('No')


t = int(input())
for _ in range(t):
	a = str(input())
	b = str(input())
	k = 0
	for i in a:
		for j in b:
			if i == j:
				k += 1
	if k > 0:
		print('Yes')
	else:
		print('No')


t = int(input())
while t > 0:
	a = input()
	b = input()
	flag = False
	for i in a:
		for j in b:
			if i == j:
				print('Yes')
				flag = True
				break
		if flag:
			break
	else:
		print('No')
	t -= 1


n = int(input())
for i in range(n):
	s1 = input()
	s2 = input()
	for j in s1:
		if j in s2:
			print('Yes')
			break
	else:
		print('No')


def palinSubStr(A, B):
	for i in range(len(A)):
		if A[i] in B:
			return 'Yes'
	return 'No'
for _ in range(int(input())):
	A = input()
	B = input()
	print(palinSubStr(A, B))


for _ in range(int(input())):
	s1 = input()
	s2 = input()
	v = 0
	for i in s1:
		if i in s2:
			v += 1
	if v != 0:
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	A = input()
	B = input()
	for e in list(A):
		if e in B:
			print('Yes')
			break
	else:
		print('No')


for _ in range(int(input())):
	s1 = input()
	s2 = input()
	flag = 0
	for k in range(len(s1)):
		if s1[k] in s2:
			flag = 1
			break
	if flag == 0:
		print('No')
	else:
		print('Yes')


t = int(input())
while t > 0:
	a = input()
	b = input()
	is_boolean = False
	for i in range(len(a)):
		if a[i] in b:
			is_boolean = True
			break
	if is_boolean:
		print('Yes')
	else:
		print('No')
	t -= 1


def solve(s1, s2):
	for i in s1:
		for j in s2:
			if i == j:
				return 'Yes'
	return 'No'
t = int(input())
for _ in range(t):
	s1 = input()
	s2 = input()
	print(solve(s1, s2))


t = int(input())
while t:
	t = t - 1
	a = input()
	b = input()
	f = 0
	for i in a:
		if i in b:
			f = 1
			break
	if f == 1:
		print('Yes')
	else:
		print('No')


t = int(input())
for _ in range(t):
	a = input()
	b = input()
	ct = 0
	for i in a:
		if i in b:
			ct = 1
			break
	if ct == 0:
		print('No')
	else:
		print('Yes')


for _ in range(int(input())):
	A = input()
	B = set(input())
	flag = 0
	for i in range(len(A)):
		if A[i] in B:
			flag = 1
			break
	if flag == 1:
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	a = input()
	b = input()
	flag = True
	for i in a:
		if i in b:
			print('Yes')
			flag = False
			break
	if flag:
		print('No')


for t in range(int(input())):
	a = str(input())
	b = str(input())
	for i in range(len(a)):
		if a[i] in b:
			print('Yes')
			break
	else:
		print('No')


for _ in range(int(input())):
	a = input()
	b = input()
	i = 0
	for x in a:
		if x in b:
			print('Yes')
			i = 1
			break
	if i == 0:
		print('No')