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.lang.reflect.Array;
import java.io.*;
import java.math.*;
import java.text.DecimalFormat;
public class Prac{   

  
  
    static class InputReader {
 
		private final InputStream stream;
		private final byte[] buf = new byte[8192];
		private int curChar, snumChars;
 
		public InputReader(InputStream st) {
			this.stream = st;
		}
 
		public int read() {
			if (snumChars == -1)
	 			throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
 
		public int ni() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
 
		public long nl() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
 
		public int[] nia(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = ni();
			}
			return a;
		}
 
		public String rs() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}
 
		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}
 
		public boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
 
		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
 
	}
    static PrintWriter w = new PrintWriter(System.out);
   
 
   
    public static void main(String[] args) throws IOException {   
        //InputReader sc=new InputReader(System.in); 
        //Scanner sc=new Scanner(System.in);
        InputReader sc=new InputReader(System.in);
        int q=sc.ni();
        while(q-->0){
            String s=sc.nextLine();
            String t=sc.nextLine();
            String p=sc.nextLine();
            int sco[]=new int[26];
            int pco[]=new int[26];
            int tco[]=new int[26];
            for(int i=0;i<s.length();i++){
                sco[s.charAt(i)-97]++;
            }
            for(int i=0;i<t.length();i++){
                tco[t.charAt(i)-97]++;
            }
            for(int i=0;i<p.length();i++){
                pco[p.charAt(i)-97]++;
            }
            boolean found=false;
            for(int i=0;i<26;i++){
                if(sco[i]>tco[i]){
                    found=true;
                    break;
                }
            }
            
            if(s.length()>t.length())
                found=true;
            if(found){
                w.println("NO");
                continue;
            }
            int j=0;
            for(int i=0;i<t.length();i++){
                if(j<s.length()&&s.charAt(j)!=t.charAt(i)){
                    if(pco[t.charAt(i)-97]>0){
                        pco[t.charAt(i)-97]--;
                        
                    }
                    else
                        found=true;
                }
                else if(j>=s.length()){
                    if(pco[t.charAt(i)-97]>0){
                        pco[t.charAt(i)-97]--;
                    }
                    else
                        found=true;
                }
                else{
                    j++;
                }
            }
            if(j<s.length())
                found=true;
            w.println((found)?"NO":"YES");
        }
        
//        int t=sc.ni();
//        while(t-->0){
//            int n=sc.ni();
//            int m=sc.ni();
//            int maxrow=-1,maxcol=-1,row=-1,col=-1;
//            char arr[][]=new char[n][m];
//            for(int i=0;i<n;i++){
//                String s=sc.nextLine();
//                for(int j=0;j<m;j++){
//                    arr[i][j]=s.charAt(j);
//                }
//            }
//            for(int i=0;i<n;i++){
//                int count=0;
//                for(int j=0;j<m;j++){
//                    if(arr[i][j]=='*'){
//                        count++;
//                    }
//                }
//                if(maxrow<count){
//                    maxrow=count;
//                    row=i;
//                }
//                
//            }
//            for(int i=0;i<m;i++){
//                int count=0;
//                for(int j=0;j<n;j++){
//                    if(arr[j][i]=='*'){
//                        count++;
//                    }
//                }
//                if(maxcol<count){
//                    maxcol=count;
//                    col=i;
//                }
//                
//            }
//            int ans=0;
//            if(arr[row][col]=='.'){
//                w.println(n-maxrow+m-maxcol-1);
//            }
//            else{
//                w.println(n-maxrow+m-maxcol);
//            }
//        }
        w.close();
    }
}