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.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Contest {

    //private static List<Integer> results = new ArrayList<>();
    //private static Map<Integer, List<Integer>> map = new HashMap<>();
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //String line = sc.nextLine();
        //int n = Integer.valueOf(line);

        String line = sc.nextLine();
        Integer q = Integer.valueOf(line);
        for (int i = 0; i < q; i++) {
            line = sc.nextLine();
            String s = line;
            line = sc.nextLine();
            String t = line;
            line = sc.nextLine();
            String p = line;
            solve(s, t, p);
        }

    }

    private static void solve(String s, String t, String p) {
        Map<String, Integer> addedCharacters = new HashMap<>();
        String[] s_split = s.split("");
        String[] t_split = t.split("");
        int counter = 0;
        outerloop:
        for (String str : s_split) {
            for (int i = counter; i < t_split.length; i++) {
                if (t_split[i].equals(str)) {
                    counter = i + 1;
                    continue outerloop;
                } else {
                    if (addedCharacters.get(t_split[i]) == null) {
                        addedCharacters.put(t_split[i], 0);
                    }
                    Integer now = addedCharacters.get(t_split[i])+1;
                    addedCharacters.put(t_split[i], now);
                    //System.out.println(t_split[i]);
                    //System.out.println(now);
                }
            }
            System.out.println("NO");
            return;
        }
        for (int i = counter; i < t_split.length; i++) {
            if (addedCharacters.get(t_split[i]) == null) {
                addedCharacters.put(t_split[i], 0);
            }
            Integer now = addedCharacters.get(t_split[i]) + 1;
            addedCharacters.put(t_split[i], now);
            //System.out.println(t_split[i]);
            //System.out.println(now);
        }

        for (String str : addedCharacters.keySet()) {
            Integer amount = addedCharacters.get(str);
            Pattern pattern = Pattern.compile(str);
            Matcher matcher = pattern.matcher(p);
            int count = 0;
            while (matcher.find()) {
                count++;
            }
            if (count < amount) {
                System.out.println("NO");
                return;
            }
        }
        System.out.println("YES");
    }

    private static void solve(int n, int m, int[][] matrix) {

    }

    public static boolean isPrime(int num) {
        if (num > 2 && num % 2 == 0) {
            //System.out.println(num + " is not prime");
            return false;
        }
        int top = (int) Math.sqrt(num) + 1;
        for (int i = 3; i < top; i += 2) {
            if (num % i == 0) {
                //System.out.println(num + " is not prime");
                return false;
            }
        }
        //System.out.println(num + " is prime");
        return true;
    }

    private static void doneList(List<Integer> a) {
        StringBuilder builder = new StringBuilder("");
        for (int i = 0; i < a.size(); i++) {
            builder.append(a.get(i)).append(" ");
        }
        System.out.println(builder.toString().substring(0, builder.toString().length() - 1));
    }

    private static void doneArray(Integer[] a) {
        StringBuilder builder = new StringBuilder("");
        for (int i = 2; i < a.length; i++) {
            builder.append(a[i]).append(" ");
        }
        System.out.println(builder.toString().substring(0, builder.toString().length() - 1));
    }

    private static void done() {
        System.out.println("-1");
    }

    private static int lowerBound(int[] a, int low, int high, int element) {
        while (low < high) {
            int middle = low + (high - low) / 2;
            if (element > a[middle]) {
                low = middle + 1;
            } else {
                high = middle;
            }
        }
        return low;
    }

    private static int upperBound(int[] a, int low, int high, int element) {
        while (low < high) {
            int middle = low + (high - low) / 2;
            if (a[middle] > element) {
                high = middle;
            } else {
                low = middle + 1;
            }
        }
        return low;
    }

}