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. 
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;

import java.lang.management.MemoryType;
import java.math.BigInteger;
import java.util.*;
import java.util.function.Function;


public class Main {
    static final int INF = Integer.MAX_VALUE;

    static int mergeSort(int[] a,int [] c, int begin, int end)
    {
        int inversion=0;
        if(begin < end)
        {
            inversion=0;
            int mid = (begin + end) >>1;
            inversion+= mergeSort(a,c, begin, mid);
            inversion+=mergeSort(a, c,mid + 1, end);
            inversion+=merge(a,c, begin, mid, end);
        }
        return inversion;
    }


    static int  merge(int[] a,int[]c, int b, int mid, int e)
    {
        int n1 = mid - b + 1;
        int n2 = e - mid;
        int[] L = new int[n1+1], R = new int[n2+1];
        int[] L1 = new int[n1+1], R1 = new int[n2+1];


        //inversion
        int inversion=0;

        for(int i = 0; i < n1; i++) {
            L[i] = a[b + i];
            L1[i] = c[b + i];
            //  L2[i] = w[b + i];
        }
        for(int i = 0; i < n2; i++)  {
            R[i] = a[mid + 1 + i];
            R1[i] = c[mid + 1 + i];
            //R2[i] = w[mid + 1 + i];
        }
        L[n1] = R[n2] = INF;

        for(int k = b, i = 0, j = 0; k <= e; k++)
            if(L[i] <= R[j]){
                a[k] = L[i];
                c[k] = L1[i];
                ++i;
                //  w[k]=L2[i++];
            }

            else
            {
                a[k] = R[j];
                c[k] = R1[j];
                //w[k] = R2[j++];
                ++j;

                inversion=inversion+(n1-i);

            }
        return inversion;

    }

    static int []c;

    static int[] v;
    static long gcd(long a, long b)
    {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }
    public class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;
        TreeNode(int x) { val = x; }

    }
    int ans;
    void  dfs(TreeNode node,int L,int R){
        if (node !=null&&node.val>=L&&node.val<=R){
            ans+=node.val;
            if (node.val>L&&node.left!=null)dfs(node.left,L,R);
            if (node.val<R&&node.right!=null)dfs(node.right,L,R);
        }
    }

    static int bs(int i,int target,int []a,int l,int r ){
        int ans=i+a[l];
        while (r>=l){
            int mid=(r+l)/2;
            if (i+a[mid]>=target){
                r=mid-1;
            }else {
                ans=mid;
                l=mid+1;
            }
        }
        return ans;

    }
    static int bs2(int i,int target,int []a,int l,int r ){
        int ans=i+a[l];
        while (r>=l){
            int mid=(r+l)/2;
            if (i+a[mid]>=target){
                ans=mid;
                r=mid-1;
            }else {
                l=mid+1;
            }
        }
        return ans;

    }




    int rangeSumBST(TreeNode root, int L, int R) {
        if (root!=null)dfs(root,L,R);
        return ans;
    }

    public static void main (String[]args) throws IOException {
        Scanner in = new Scanner(System.in);
        try(PrintWriter or = new PrintWriter(System.out)) {
            int n=in.nextInt();
            while (n-->0){

                StringBuilder s=new StringBuilder(in.next());
                StringBuilder t= new StringBuilder(in.next());
                PriorityQueue<Character>p = new PriorityQueue<>();

                char [] a= in.next().toCharArray();
                for (int i = 0; i < a.length; i++) p.offer(a[i]);

                if (s.length()>t.length()||s.length()<t.length()&&s.length()+p.size()<t.length()||(s.length()==t.length()&&!s.toString().equals(t.toString())
                ))or.println("NO");
                else{
                    boolean b=true;
                    for (int i = 0; i < Math.min(s.length(),t.length()); i++) {
                        if (s.charAt(i)!=t.charAt(i)){
                            if (p.contains(t.charAt(i))){
                                s.insert(i,t.charAt(i));
                                p.remove(t.charAt(i--));
                            }else {
                                b=false;
                                break;
                            }
                        }
                    }
                    if (s.length()<t.length()){
                        String substring = t.substring(s.length());

                        for (int i = 0; i < substring.length(); i++) {
                            if (!p.contains(substring.charAt(i))){
                                b=false;
                                break;
                            }
                            s.append(substring.charAt(i));
                            p.remove(substring.charAt(i));
                        }
                    }


                    or.println(s.toString().equals(t.toString())?"YES":"NO");
                }


            }


        }

    }
    static int getlen(int r,int l,int a){
        return (r-l+1+1)/(a+1);
    }






    static class Scanner {

        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

    }
}

class Pair implements Comparable<Pair> {
    int first, second;

    public Pair(int first, int second) {
        this.first = first;
        this.second = second;
    }

    @Override
    public int compareTo(Pair o) {
        return first - o.first;
    }


}

class Tempo {

    int num;
    int index;

    public Tempo(int num, int index) {
        this.num = num;
        this.index = index;
    }
}