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 javafx.util.Pair;
import java.io.*;
import java.math.*;
import java.security.Key;
import java.util.*;
@SuppressWarnings("Duplicates")
// author @mdazmat9
// swing +socket java(udemy)
//1
//3 3
//.*.
//*.*
//...
public class codeforces{
    static Scanner sc = new Scanner(System.in);
    static PrintWriter out = new PrintWriter(System.out);
    public static void main(String[] args) throws IOException {
        int test = 1;
        test=sc.nextInt();
        for (int ind = 0; ind < test; ind++) {
           String aa=sc.next();
           String bb=sc.next();
           String cc=sc.next();
           ArrayList<Character> a=new ArrayList<>();
           ArrayList<Character> b=new ArrayList<>();
           HashMap<Character,Integer> map=new HashMap<>();
            for(int i=0;i<aa.length();i++)a.add(aa.charAt(i));
            for(int i=0;i<bb.length();i++)b.add(bb.charAt(i));
            for(int i=0;i<cc.length();i++){
                if(map.containsKey(cc.charAt(i))){
                    map.put(cc.charAt(i),map.get(cc.charAt(i))+1);
                }
                else map.put(cc.charAt(i),1);
            }
            int ind_a=0,ind_b=0,ind_c=0;
            if(aa.length()>bb.length()){
                out.println("NO");
            }
            else if(aa.length()==bb.length()){
                if(aa.equals(bb)){
                    out.println("YES");
                }
                else {
                    out.println("NO");
                }
            }
            else {
                 ind_a=0;
                boolean[] array=new boolean[b.size()];

                for(int i=0;i<b.size();i++){
                    if(ind_a<a.size()&& a.get(ind_a)==b.get(i)){
                        ind_a++;
                        array[i]=true;
                    }
                }
                if(ind_a!=a.size()){
                    out.println("NO");
                }
                else {
                    boolean bool=true;
                    for(int i=0;i<b.size();i++){
                        if(!array[i]){
                            char cr=b.get(i);
                            if(map.containsKey(cr) && map.get(cr)>0){
                                map.put(cr,map.get(cr)-1);
                            }
                            else {
                                bool=false;
                                break;
                            }
                        }
                    }
                    if(bool){
                        out.println("YES");
                    }
                    else out.println("NO");
                }
            }


        }
        out.flush();
    }
    static long anscount(char[][]a,int n,int m,int row_max_index,int col_max_index){
        boolean [][]bool=new boolean[n][m];
        long count=0;
        for(int i=0;i<m;i++){
            if(a[row_max_index][i]=='*'){
                bool[row_max_index][i]=true;
            }
            else {
                if(!bool[row_max_index][i])count++;
                bool[row_max_index][i]=true;
            }
        }
        for(int i=0;i<n;i++){
            if(a[i][col_max_index]=='*'){
                bool[i][col_max_index]=true;
            }
            else {
                if(!bool[i][col_max_index])count++;
                bool[i][col_max_index]=true;
            }
        }
        return count;
    }



    static long[] longarray(int n){ long [] a=new long[n];for(int i=0;i<n;i++)a[i]=sc.nextLong();return a; }
    static int[] intarray(int n){ int [] a=new int[n];for(int i=0;i<n;i++)a[i]=sc.nextInt();return a; }
    static ArrayList<Integer> intlist(int n){ArrayList<Integer> list=new ArrayList<>();for(int i=0;i<n;i++)list.add(sc.nextInt());return list; }
    static ArrayList<Long> longlist(int n){ArrayList<Long> list=new ArrayList<>();for(int i=0;i<n;i++)list.add(sc.nextLong());return list; }
    static int[][] read2darray(int n,int m){ int [][] a=new int[n][m];for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ a[i][j]=sc.nextInt(); } }return a; }
    public static double logb( double a, double b ) {return Math.log(a) / Math.log(b); }
    static long fast_pow(long a, long b,long abs) {
        if(b == 0) return 1L;
        long val = fast_pow(a, b / 2,abs);
        if(b % 2 == 0) return val * val % abs;
        else return val * val % abs * a % abs;
    }
    static long abs = (long)1e9 + 7;
    static   void shuffle(int[] a) { int n = a.length;for(int i = 0; i < n; i++) { int r = i + (int) (Math.random() * (n - i));int tmp = a[i];a[i] = a[r];a[r] = tmp; } }
    static long gcd(long a , long b) {
        if(b == 0) return a;
        return gcd(b , a % b);
    }
}


class Scanner {
    public BufferedReader reader;
    public StringTokenizer st;
    public Scanner(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        st = null;
    }
    public String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = reader.readLine();
                if (line == null) return null;
                st = new StringTokenizer(line);
            } catch (Exception e) {
                throw (new RuntimeException());
            }
        }
        return st.nextToken();
    }
    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong() {
        return Long.parseLong(next());
    }
    public double nextDouble() {
        return Double.parseDouble(next());
    }
}
class OutputWriter {
    BufferedWriter writer;
    public OutputWriter(OutputStream stream) {
        writer = new BufferedWriter(new OutputStreamWriter(stream));
    }
    public void print(int i) throws IOException {
        writer.write(i);
    }
    public void print(String s) throws IOException {
        writer.write(s);
    }
    public void print(char[] c) throws IOException {
        writer.write(c);
    }
    public void close() throws IOException {
        writer.close();
    }
}