You are given two strings of equal length $s$ and $t$ consisting of lowercase Latin letters. You may perform any number (possibly, zero) operations on these strings.

During each operation you choose two adjacent characters in any string and assign the value of the first character to the value of the second or vice versa.

For example, if $s$ is "acbc" you can get the following strings in one operation:   "aabc" (if you perform $s_2 = s_1$);  "ccbc" (if you perform $s_1 = s_2$);  "accc" (if you perform $s_3 = s_2$ or $s_3 = s_4$);  "abbc" (if you perform $s_2 = s_3$);  "acbb" (if you perform $s_4 = s_3$); 

Note that you can also apply this operation to the string $t$.

Please determine whether it is possible to transform $s$ into $t$, applying the operation above any number of times.

Note that you have to answer $q$ independent queries.


-----Input-----

The first line contains one integer $q$ ($1 \le q \le 100$) — the number of queries. Each query is represented by two consecutive lines.

The first line of each query contains the string $s$ ($1 \le |s| \le 100$) consisting of lowercase Latin letters.

The second line of each query contains the string $t$ ($1 \le |t| \leq 100$, $|t| = |s|$) consisting of lowercase Latin letters.


-----Output-----

For each query, print "YES" if it is possible to make $s$ equal to $t$, and "NO" otherwise.

You may print every letter in any case you want (so, for example, the strings "yEs", "yes", "Yes", and "YES" will all be recognized as positive answer).


-----Example-----
Input
3
xabb
aabx
technocup
technocup
a
z

Output
YES
YES
NO



-----Note-----

In the first query, you can perform two operations $s_1 = s_2$ (after it $s$ turns into "aabb") and $t_4 = t_3$ (after it $t$ turns into "aabb"). 

In the second query, the strings are equal initially, so the answer is "YES".

In the third query, you can not make strings $s$ and $t$ equal. Therefore, the answer is "NO".

Difficulty: interview

Starter code:

Solutions:
for _ in range(int(input())):
    print("YES" if set(input()).intersection(input()) else "NO")


for _ in range(int(input())):
    s = input()
    t = input()
    ans = 'NO'
    for c in s:
        if c in t:
            ans = 'YES'
            break
    print(ans)

q = int(input())
for z in range(q):
    s = input()
    t = input()
    for c in s:
        if c in t:
            print('YES')
            break
    else:
        print('NO')

q = int(input())
for qq in range(q):
    s1 = input()
    s2 = input()
    for i in s1:
        if i in s2:
            print('YES')
            break
    else:
        print('NO')
    




q = int(input())
for i in range(q):
    a = input()
    b = input()
    done = False
    for i in a:
        if i in b:
            done = True
            break
    print('YES' if done else 'NO')

n = int(input())
for i in range(n):
    a = input()
    b = input()
    a, b = min(a, b), max(a, b)
    h = True
    for j in range(len(a)):
        if a[j] in b:
            print('YES')
            h = False
            break
    if h:
        print('NO')



for _ in range(int(input())):
    line1 = input()
    line2 = input()
    if set(line1) & set(line2):
        print("YES")
    else:
        print("NO")


for i in range(int(input())):
    s1 = set(input())
    s2 = set(input())
    if len(s1 & s2) > 0:
        print("YES")
    else:
        print("NO")
    


q = int(input())
for i in range(q):
    s = input()
    t = input()
    s = set(s)
    t = set(t)
    if len(s.intersection(t)) > 0:
        print('YES')
    else:
        print('NO')

a = int(input())
for i in range(a):
    b = input()
    c = input()
    y = 0
    for i in b:
        if i in c:
            y = 1
        else:
            pass
    if  y == 1:
        print('YES')
    else:
        print("NO")

for _ in range(int(input())):
    s,t=input(), input()
    k="NO"
    for i in s:
        if i in t:
            k="YES"
            break
    print(k)

n=int(input())
for i in range(n):
    s=input()
    t=input()
    s1 = set()
    s2=set()
    for q in s:
        s1.add(q)
    for q in t:
        s2.add(q)
    if len(s1.intersection(s2)):
        print('YES')
    else:
        print('NO')

q = int(input())
for i in range(q):
    s1 = input()
    s2 = input()
    if len(set(s1) & set(s2)) > 0:
        print('YES')
    else:
        print('NO')


q = int(input())

for i in range(q):
    s = input()
    t = input()
    if set(s) & set(t):
        print('YES')
    else:
        print('NO')


q = int(input())
for i in range(q):
    k = 0
    s = input()
    t = input()
    for p in range(len(s)):
        for j in range(len(s)):
            if s[p] == t[j]:
                k += 1
    if k > 0:
        print('YES')
    else:
        print('NO')

import sys
import math
from math import ceil
import bisect
 
def input():
    return sys.stdin.readline().strip()
 
def iinput():
    return int(input())
 
def finput():
    return float(input())
 
def tinput():
    return input().split()
 
def rinput():
    return map(float, tinput())
 
def rlinput():
    return list(rinput())

def sli():
    return set(list(input()))
 
def modst(a, s):
    res = 1
    while s:
        if s % 2:
            res *= a
        a *= a
        s //= 2
    return res   

def pro(x):
    if x < 37:
        return (x - 1) // 4
    else:
        return 8 - (x - 37) // 2
 
 
def main():  
    q = sli()
    w = sli()
    flag = False
    for i in q:
        if i in w:
            flag = True
            break
    if flag:
        print('YES')
    else:
        print('NO')
        
for i in range(iinput()):
    main() 

q = int(input())
for i in range(q):
    c = True
    s = input()
    t = input()
    for j in s:
        if j in t:
            print("YES")
            c = False
            break
    if c:
        print("NO")

q=int(input())
for i in range(q):
    test=set()
    s=list(input())
    t=list(input())
    for item in s:
        test.add(item)
    for item in t:
        if item in test:
            print('YES')
            break
    else:
            print('NO')


n = int(input())
for i in range(n):
    m1 = set(list(input()))
    m2 = set(list(input()))
    f = 'NO'
    for el in m1:
        if el in m2:
            f = 'YES'
    print(f)

q = int(input())
for i in range(q):
    s1 = input()
    s2 = input()
    f = 1
    for i in range(len(s1)):
        for j in range(len(s2)):
            if f and s1[i] == s2[j]:
                print("YES")
                f = 0
    if f:
        print("NO")