Problem: You are given three strings s, t and p consisting of lowercase Latin letters. You may perform any number (possibly, zero) operations on these strings.

During each operation you choose any character from p, erase it from p and insert it into string s (you may insert this character anywhere you want: in the beginning of s, in the end or between any two consecutive characters). 

For example, if p is aba, and s is de, then the following outcomes are possible (the character we erase from p and insert into s is highlighted):

  * aba → ba, de → ade; 
  * aba → ba, de → dae; 
  * aba → ba, de → dea; 
  * aba → aa, de → bde; 
  * aba → aa, de → dbe; 
  * aba → aa, de → deb; 
  * aba → ab, de → ade; 
  * aba → ab, de → dae; 
  * aba → ab, de → dea; 



Your goal is to perform several (maybe zero) operations so that s becomes equal to t. Please determine whether it is possible.

Note that you have to answer q independent queries.

Input

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

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

The second line of each query contains the string t (1 ≤ |t| ≤ 100) consisting of lowercase Latin letters.

The third line of each query contains the string p (1 ≤ |p| ≤ 100) 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


4
ab
acxb
cax
a
aaaa
aaabbcc
a
aaaa
aabbcc
ab
baaa
aaaaa


Output


YES
YES
NO
NO

Note

In the first test case there is the following sequence of operation: 

  1. s =  ab, t =  acxb, p =  cax; 
  2. s =  acb, t =  acxb, p =  ax; 
  3. s =  acxb, t =  acxb, p =  a. 



In the second test case there is the following sequence of operation: 

  1. s =  a, t =  aaaa, p =  aaabbcc; 
  2. s =  aa, t =  aaaa, p =  aabbcc; 
  3. s =  aaa, t =  aaaa, p =  abbcc; 
  4. s =  aaaa, t =  aaaa, p =  bbcc. 

Solution (in PYTHON3):

Solution:
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 14 18:25:48 2019

@author: Hamadeh
"""

class cinn:
    def __init__(self):
        self.x=[]
    def cin(self,t=int):
        if(len(self.x)==0):
            a=input()
            self.x=a.split()
            self.x.reverse()
        return self.get(t)
    def get(self,t):
        return t(self.x.pop())
    def clist(self,n,t=int): #n is number of inputs, t is type to be casted
        l=[0]*n
        for i in range(n):
            l[i]=self.cin(t)
        return l
    def clist2(self,n,t1=int,t2=int,t3=int,tn=2):
        l=[0]*n
        for i in range(n):
            if(tn==2):
                a1=self.cin(t1)
                a2=self.cin(t2)
                l[i]=(a1,a2)
            elif (tn==3):
                a1=self.cin(t1)
                a2=self.cin(t2)
                a3=self.cin(t3)
                l[i]=(a1,a2,a3)
        return l
    def clist3(self,n,t1=int,t2=int,t3=int):
        return self.clist2(self,n,t1,t2,t3,3)
    def cout(self,i,ans=''):   
        if(ans==''):
            print("Case #"+str(i+1)+":", end=' ')
        else:
            print("Case #"+str(i+1)+":",ans)
    def printf(self,thing):
        print(thing,end='')
    def countlist(self,l,s=0,e=None):
        if(e==None):
            e=len(l)
        dic={}
        for el in range(s,e):
            if l[el] not in dic:
                dic[l[el]]=1
            else:
                dic[l[el]]+=1
        return dic
    def talk (self,x):
        print(x,flush=True)
    def dp1(self,k):
        L=[-1]*(k)
        return L
    def dp2(self,k,kk):
        L=[-1]*(k)
        for i in range(k):
            L[i]=[-1]*kk
        return L
    def isprime(self,n):
        if(n==1 or n==0):
            return False
        for i in range(2,int(n**0.5+1)):
            if(n%i==0):
                return False
        return True
    def factors(self,n):    
        from functools import reduce
        return set(reduce(list.__add__, 
                    ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))
    def nthprime(self,n):
        #usable up to 10 thousand
        i=0
        s=2
        L=[]
        while(i<n):
            while(not self.isprime(s)):
                s+=1
            L.append(s)
            s+=1
            i+=1
        return L
    def matrixin(self,m,n,t=int):
        L=[]
        for i in range(m):
            p=self.clist(n,t)
            L.append(p)
        return L
    def seive(self,k):
        #1000000 tops
        n=k+1
        L=[True]*n
        L[1]=False
        L[0]=False
        for i in range(2,n):
            if(L[i]==True):
                for j in range(2*i,n,i):
                    L[j]=False
        return L
    def seiven(self,n,L):
        i=0
        for j in range(len(L)):
            if(L[j]==True):
                i+=1
            if(i==n):
                return j
    def matrixin2(self,m,t=int):
        L=[]
        for i in range(m):
            iny=self.cin(str)
            lsmall=[]
            for el in iny:
                lsmall.append(t(el))
            L.append(lsmall)
        return L
def isSubSequence(str1,str2,m,n): 
      
    j = 0    # Index of str1 
    i = 0    # Index of str2 
      
    # Traverse both str1 and str2 
    # Compare current character of str2 with  
    # first unmatched character of str1 
    # If matched, then move ahead in str1 
      
    while j<m and i<n: 
        if str1[j] == str2[i]:     
            j = j+1    
        i = i + 1
    return j==m 
c=cinn()
x=c.cin()
for i in range(x):
    s=c.cin(str)
    t=c.cin(str)
    p=c.cin(str)
    if(not isSubSequence(s,t,len(s),len(t))):
        print("NO")
        continue      
    tcount=c.countlist(t)
    poss=True
    #print(tcount)
    for el in s:
        if(el not in tcount):
            poss=False
            break
        else:
            tcount[el]-=1
            if(tcount[el]==0):
                tcount.pop(el,None)
    #print(tcount)
    if(not poss):
        print("NO")
    else:
        for el in p:
            if(el in tcount):
                tcount[el]-=1
                if(tcount[el]==0):
                    tcount.pop(el,None)
        if(tcount):
            print("NO")
        else:
            print("YES")