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;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int mxn = 100033;
const int mod = 1e9 + 7;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (!isdigit(c)) f = c == '-' ? -1 : 1, c = getchar();
  while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
  return x * f;
}
inline long long gcd(long long a, long long b) {
  return b == 0 ? a : gcd(b, a % b);
}
long long ksm(long long a, long long b, long long mod) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return ans;
}
long long inv2(long long a, long long mod) { return ksm(a, mod - 2, mod); }
void exgcd(long long a, long long b, long long &x, long long &y, long long &d) {
  if (!b) {
    d = a;
    x = 1;
    y = 0;
  } else {
    exgcd(b, a % b, y, x, d);
    y -= x * (a / b);
  }
}
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
string s, t;
int dp[410][410];
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  std::cout.tie(0);
  ;
  int ca;
  cin >> ca;
  while (ca--) {
    cin >> s >> t;
    int flg = 0;
    int ls = s.length(), lt = t.length();
    s = ' ' + s;
    t = ' ' + t;
    for (int d = 0; d <= lt; ++d) {
      string t1 = t.substr(1, d), t2 = t.substr(d + 1);
      int l1 = d, l2 = lt - d;
      t1 = ' ' + t1;
      t2 = ' ' + t2;
      memset((dp), (-1), sizeof((dp)));
      dp[0][0] = 0;
      for (int i = 0; i <= ls; ++i)
        for (int j = 0; j <= min(i, l1); ++j) {
          dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
          if (s[i + 1] == t1[j + 1])
            dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j]);
          if (dp[i][j] >= 0 && s[i + 1] == t2[dp[i][j] + 1])
            dp[i + 1][j] = max(dp[i + 1][j], dp[i][j] + 1);
        }
      if (dp[ls][l1] >= l2) {
        flg = 1;
        break;
      }
    }
    if (flg)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
