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;
using ll = long long;
using cp = complex<double>;
namespace IO {
template <typename T, typename... T2>
inline bool read(T &num, T2 &...rest);
inline bool read() { return true; }
template <typename... T>
inline bool read(char *a, T &...rest) {
  int ch = getchar();
  for (; ch < 33 || ch > 126; ch = getchar())
    if (ch == EOF) return false;
  for (; ch >= 33 && ch <= 126; ch = getchar()) {
    *(a++) = ch;
  }
  *a = 0;
  return read(rest...);
}
template <typename T, typename... T2>
inline bool read(T &num, T2 &...rest) {
  num = 0;
  bool fl = 0;
  int ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-')
      fl = 1;
    else if (ch == EOF) {
      return false;
    }
  for (; isdigit(ch); ch = getchar()) num = (num << 3) + (num << 1) + (ch ^ 48);
  if (fl) num = -num;
  return read(rest...);
}
void put() { puts(""); }
template <class... T2>
void put(const ll num, const T2... rest);
template <class... T2>
void put(const char *num, const T2... rest);
template <class... T2>
void put(const char num, const T2... rest);
template <class... T2>
void put(const double num, const T2... rest);
template <class... T2>
void put(const int num, const T2... rest) {
  printf("%d ", num);
  put(rest...);
}
template <class... T2>
void put(const ll num, const T2... rest) {
  printf("%lld ", num);
  put(rest...);
}
template <class... T2>
void put(const char *num, const T2... rest) {
  printf("%s ", num);
  put(rest...);
}
template <class... T2>
void put(const char num, const T2... rest) {
  printf("%c ", num);
  put(rest...);
}
template <class... T2>
void put(const double num, const T2... rest) {
  printf("%.13f ", num);
  put(rest...);
}
void yes() { puts("YES"); }
void no() { puts("NO"); }
void ff() { fflush(stdout); }
}  // namespace IO
using namespace IO;
using db = double;
using vi = vector<int>;
using pi = pair<int, int>;
const int mod = 998244353, inv2 = (mod + 1) / 2;
const int maxn = 400 + 10;
const int inf = 1e9 + 3;
void prepare() {}
char s[maxn], t[maxn];
int sn, tn;
ll f[maxn][maxn][2];
void Solve(int cas = 1) {
  ll n, m;
  read(s + 1);
  read(t + 1);
  ll sn = n = strlen(s + 1);
  ll tn = strlen(t + 1);
  t[tn + 2] = 0;
  for (int p = 1; p <= tn; p++) {
    char *tt = t + p;
    ll t2 = tn - p;
    for (int i = 0; i <= sn; i++) {
      for (int j = 0; j <= tn; j++) {
        f[i][j][0] = f[i][j][1] = -1;
      }
    }
    f[1][0][1] = -1;
    f[1][0][0] = (s[1] == tt[1] ? 1 : 0);
    f[1][1][1] = (s[1] == t[1] ? 0 : -1);
    f[1][1][0] = -1;
    for (int i = 2; i <= sn; i++) {
      for (int j = 0; j <= p; j++) {
        if (j) {
          if (s[i] == t[j])
            f[i][j][1] = max(f[i - 1][j - 1][0], f[i - 1][j - 1][1]);
        }
        int k0 = max(f[i - 1][j][0], f[i - 1][j][1]);
        if (k0 != -1) k0 += (s[i] == tt[k0 + 1]);
        f[i][j][0] = k0;
      }
    }
    if (f[sn][p][0] == t2 || f[sn][p][1] == t2) {
      yes();
      return;
    }
  }
  no();
}
void Solvem() {
  int T;
  read(T);
  for (int i = 1; i <= T; i++) Solve(i);
}
int main() {
  prepare();
  Solvem();
  return 0;
}
