You are given a string s. You can build new string p from s using the following operation no more than two times: 

  1. choose any subsequence s_{i_1}, s_{i_2}, ..., s_{i_k} where 1 ≤ i_1 < i_2 < ... < i_k ≤ |s|; 
  2. erase the chosen subsequence from s (s can become empty); 
  3. concatenate chosen subsequence to the right of the string p (in other words, p = p + s_{i_1}s_{i_2}... s_{i_k}). 



Of course, initially the string p is empty. 

For example, let s = ababcd. At first, let's choose subsequence s_1 s_4 s_5 = abc — we will get s = bad and p = abc. At second, let's choose s_1 s_2 = ba — we will get s = d and p = abcba. So we can build abcba from ababcd.

Can you build a given string t using the algorithm above?

Input

The first line contains the single integer T (1 ≤ T ≤ 100) — the number of test cases.

Next 2T lines contain test cases — two per test case. The first line contains string s consisting of lowercase Latin letters (1 ≤ |s| ≤ 400) — the initial string.

The second line contains string t consisting of lowercase Latin letters (1 ≤ |t| ≤ |s|) — the string you'd like to build.

It's guaranteed that the total length of strings s doesn't exceed 400.

Output

Print T answers — one per test case. Print YES (case insensitive) if it's possible to build t and NO (case insensitive) otherwise.

Example

Input


4
ababcd
abcba
a
b
defi
fed
xyz
x


Output


YES
NO
NO
YES

import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

import static java.lang.Integer.min;

public class EraseSubsequences implements Closeable {

  private InputReader in = new InputReader(System.in);
  private PrintWriter out = new PrintWriter(System.out);

  public void solve() {
    int T = in.ni();
    while (T-- > 0) {
      char[] s = in.next().toCharArray(), t = in.next().toCharArray();
      int n = s.length, m = t.length;
      int[][] next = new int[n + 3][26];
      for (int j = 0; j < 26; j++) {
        next[n][j] = next[n + 1][j] = next[n + 2][j] = n + 1;
      }
      for (int i = n; i >= 1; i--) {
        next[i][s[i - 1] - 'a'] = i;
        for (int j = 0; j < 26; j++) {
          next[i - 1][j] = next[i][j];
        }
      }

      boolean possible = false;
      for (int k = 0; k < m; k++) {
        int[][] dp = new int[k + 1][m - k + 1];
        dp[0][0] = 0;
        for (int i = 1; i <= k; i++) {
          dp[i][0] = next[dp[i - 1][0] + 1][t[i - 1] - 'a'];
        }
        for (int i = 1; i <= m - k; i++) {
          dp[0][i] = next[dp[0][i - 1] + 1][t[k + i - 1] - 'a'];
        }
        for (int i = 1; i <= k; i++) {
          for (int j = 1; j <= m - k; j++) {
            dp[i][j] = min(next[dp[i - 1][j] + 1][t[i - 1] - 'a'], next[dp[i][j - 1] + 1][t[k + j - 1] - 'a']);
          }
        }
        possible |= (dp[k][m - k] <= n);
      }
      out.println(possible ? "YES" : "NO");
    }
  }

  @Override
  public void close() throws IOException {
    in.close();
    out.close();
  }

  static class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream), 32768);
      tokenizer = null;
    }

    public String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public int ni() {
      return Integer.parseInt(next());
    }

    public long nl() {
      return Long.parseLong(next());
    }

    public void close() throws IOException {
      reader.close();
    }
  }

  public static void main(String[] args) throws IOException {
    try (EraseSubsequences instance = new EraseSubsequences()) {
      instance.solve();
    }
  }
}
