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 JAVA):

Solution:
import java.util.*;
import java.lang.*;
import java.io.*;
public class Codechef
{   static PrintWriter out=new PrintWriter(System.out);
	static FastScanner in = new FastScanner(System.in);
     static class FastScanner {
        BufferedReader br;
        StringTokenizer stok;
        FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }
        String next() throws IOException {
            while (stok == null || !stok.hasMoreTokens()) {
                String s = br.readLine();
                if (s == null) {
                    return null;
                }
                stok = new StringTokenizer(s);
            }
            return stok.nextToken();
        }
        int ni() throws IOException {
            return Integer.parseInt(next());
        }
        long nl() throws IOException {
            return Long.parseLong(next());
        }
        double nd() throws IOException {
            return Double.parseDouble(next());
        }
        char nc() throws IOException {
            return (char) (br.read());
        }
        String ns() throws IOException {
            return br.readLine();
        }
        int[] nia(int n) throws IOException{
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }
        long[] nla(int n) throws IOException {
            long a[] = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nl();
            return a;
        }
        double[] nda(int n)throws IOException {
            double a[] = new double[n];
            for (int i = 0; i < n; i++)
                a[i] = nd();
            return a;
        }
        int [][] imat(int n,int m) throws IOException
        {   int mat[][]=new int[n][m];
            for(int i=0;i<n;i++)
            {   for(int j=0;j<m;j++)
                   mat[i][j]=ni();
            }
            return mat;
        }
    }
    
    ///     PRINTING FUNCTIONS
    
    static void pia(int arr[]) throws IOException
        {   for(int i=0;i<arr.length;i++)
                out.print(arr[i]+" ");
            out.println();
        }
    static void pla(long arr[]) throws IOException
        {   for(int i=0;i<arr.length;i++)
                out.print(arr[i]+" ");
            out.println();
        }
    static void pimat(int mat[][])
        {   for(int i=0;i<mat.length;i++)
            {   for(int j=0;j<mat[0].length;j++)
                    out.print(mat[i][j]);
            out.println();
        }
    }
        
    ///MAIN METHOD
    
    
    
    
	static long mod=Long.MAX_VALUE;
	public static void main (String[] args) throws java.lang.Exception
	{   int i,j;
	    ArrayList<Integer> arr=new ArrayList<Integer>();
        HashSet<Integer> set=new HashSet<Integer>();
        PriorityQueue<Integer> pq=new PriorityQueue<Integer>();
        /*  int n = in.ni();
            int m = in.ni();
            String s=in.ns();
            int a[]=in.nia(n);
            int b[][]=in.im(n,m);
            pia(a);
		    pimat(b);
		
        */
        int q=in.ni();
		while(q--!=0)
		{
		   String s=in.next();
		   String t=in.next();
		   String p=in.next();
		   //out.println(s+" "+t+" "+p);
		   if(t.length()>=s.length())
		   {
		       HashMap<Character,Integer> hm=new HashMap<>();
		       for(i=0;i<p.length();i++)
		       {
		          char z=p.charAt(i); 
		        if(hm.containsKey(z))
		            hm.put(z,hm.get(z)+1);
		        else
		             hm.put(z,1);
		       }
		       int temp1=0,temp2=0,length=0;
		       int flag=0;
		       while(true && temp2<t.length())
		       {   // System.out.println("temp1="+temp1+" temp2="+temp2);
		           // out.println(hm);
		           if(temp1<s.length() &&s.charAt(temp1)==t.charAt(temp2))
		           {temp1++;temp2++;}
		           else
		           {
		               if(hm.containsKey(t.charAt(temp2)) && hm.get(t.charAt(temp2))!=null && hm.get(t.charAt(temp2))>0)
		               {
		                  
		                   hm.put(t.charAt(temp2),hm.get(t.charAt(temp2))-1);length++;temp2++;
		             //      out.println("**" +hm);
		                   
		               }
		               else
		               {flag=-1;break;}
		           }
		       }
		       if(flag==-1)
		        out.println("No");
		       else if(length+s.length()!=t.length()) 
		        out.println("No");
		       else
		       out.println("YES");
        
		   }
		   else
		    out.println("No");
		   //out.println("____________________________________________");
		}
		
		
		
		
		
		out.close();
	}
	
	
	
	
	
	static long gcd(long a,long b)
	{   if(b==0)
	        return a;
	    return gcd(b,a%b);    
	}
	static long exponent(long a,long n)
	{   long ans=1;
	    while(n!=0)
	    {   if(n%2==1)
	            ans=(ans*a)%mod;
	       a=(a*a)%mod;
	       n=n>>1;
	    }
	    return ans;
	}
	static int binarySearch(int a[], int item, int low, int high) 
    {   if (high <= low) 
            return (item > a[low])?  (low + 1): low; 
        int mid = (low + high)/2; 
        if(item == a[mid]) 
            return mid+1; 
        if(item > a[mid]) 
            return binarySearch(a, item, mid+1, high); 
        return binarySearch(a, item, low, mid-1); 
    } 
}