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
#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long exp(long long a, long long b, long long m) {
  if (b == 0) return 1;
  if (b == 1) return mod(a, m);
  long long k = mod(exp(a, b / 2, m), m);
  if (b & 1) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
long long dp[410][410];
long long pos[410][30];
long long n, m;
string s;
string t;
long long go(long long L) {
  for (long long i = 0; i <= L + 1; i++) {
    for (long long j = 0; j <= m; j++) {
      dp[i][j] = n + 100;
    }
  }
  dp[0][0] = 0;
  for (long long j = 1; j <= m - L; j++) {
    if (dp[0][j - 1] < n)
      dp[0][j] = pos[dp[0][j - 1]][t[j + L - 1] - 'a'] + 1;
    else
      dp[0][j] = n + 100;
  }
  for (long long i = 1; i <= L; i++) {
    for (long long j = 0; j <= m - L; j++) {
      dp[i][j] = n + 100;
      if (j == 0) {
        if (dp[i - 1][j] < n)
          dp[i][j] = pos[dp[i - 1][j]][t[i - 1] - 'a'] + 1;
        else
          dp[i][j] = n + 100;
      } else {
        if (dp[i - 1][j] < n)
          dp[i][j] = pos[dp[i - 1][j]][t[i - 1] - 'a'] + 1;
        else
          dp[i][j] = n + 100;
        if (dp[i][j - 1] < n)
          dp[i][j] = min(dp[i][j], pos[dp[i][j - 1]][t[j + L - 1] - 'a'] + 1);
      }
    }
  }
  if (dp[L][m - L] <= n) return true;
  return false;
}
void solve() {
  cin >> s;
  cin >> t;
  n = s.size();
  m = t.size();
  for (long long j = 0; j < 26; j++) {
    pos[n][j] = n + 100;
  }
  for (long long i = n - 1; i >= 0; i--) {
    for (long long j = 0; j < 26; j++) {
      pos[i][j] = pos[i + 1][j];
    }
    pos[i][s[i] - 'a'] = i;
  }
  for (long long i = 0; i < m; i++) {
    if (go(i)) {
      cout << "YES"
           << "\n";
      return;
    }
  }
  cout << "NO"
       << "\n";
  return;
}
int32_t main() {
  long long T;
  cin >> T;
  while (T--) {
    solve();
  }
}
