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 int OO = 1e9;
const double EPS = 1e-9;
template <class T>
void _db(const char* dbStr, T e) {
  cout << dbStr << " = " << e << endl;
}
template <class T, class... L>
void _db(const char* dbStr, T e, L... r) {
  while (*dbStr != ',') cout << *dbStr++;
  cout << " = " << e << ',';
  _db(dbStr + 1, r...);
}
template <class S, class T>
ostream& operator<<(ostream& o, const map<S, T>& v) {
  o << "[";
  int i = 0;
  for (const pair<S, T>& pr : v)
    o << (!i++ ? "" : ", ") << "{" << pr.first << " : " << pr.second << "}";
  return o << "]";
}
template <template <class, class...> class S, class T, class... L>
ostream& operator<<(ostream& o, const S<T, L...>& v) {
  o << "[";
  int i = 0;
  for (const auto& e : v) o << (!i++ ? "" : ", ") << e;
  return o << "]";
}
template <class S, class T>
ostream& operator<<(ostream& o, const pair<S, T>& pr) {
  return o << "(" << pr.first << ", " << pr.second << ")";
}
ostream& operator<<(ostream& o, const string& s) {
  for (const char& c : s) o << c;
  return o;
}
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;
template <class T>
using VVV = VV<V<T>>;
using ll = long long;
using pii = pair<int, int>;
using vi = V<int>;
using vii = V<pii>;
using vvi = VV<int>;
using mii = map<int, int>;
using umii = unordered_map<int, int>;
using si = set<int>;
using usi = unordered_set<int>;
const int MX = 405;
int dp[MX][MX], Next[MX][27];
string a, b;
int main() {
  ios::sync_with_stdio(false);
  cout.precision(10);
  cin.tie(0);
  int T;
  cin >> T;
  for (int tc = 1; tc <= T; ++tc) {
    string ss, tt;
    cin >> ss >> tt;
    vi s, t;
    for (int i = 0; i < int(ss.size()); ++i) {
      s.push_back(ss[i] - 'a');
    }
    for (int i = 0; i < int(tt.size()); ++i) {
      t.push_back(tt[i] - 'a');
    }
    s.push_back(26);
    int n = int(s.size());
    for (int i = 0; i < 27; ++i) {
      Next[n][i] = OO;
    }
    true;
    for (int i = n - 1; i >= 0; --i) {
      for (int j = 0; j < 27; ++j) {
        if (s[i] == j)
          Next[i][j] = i;
        else
          Next[i][j] = Next[i + 1][j];
      }
    }
    bool good = false;
    for (int i = 1; i <= int(t.size()); ++i) {
      vi L, R;
      if (i == int(t.size()))
        L = t, R = vi({26});
      else {
        for (int j = 0; j < int(t.size()); ++j) {
          if (j < i)
            L.push_back(t[j]);
          else
            R.push_back(t[j]);
        }
      }
      int l = int(L.size()), r = int(R.size());
      true;
      dp[0][0] = 0;
      for (int i = 0; i <= l; ++i) {
        for (int j = 0; j <= r; ++j) {
          if (!i && !j) continue;
          dp[i][j] = OO;
          if (i && dp[i - 1][j] < n)
            dp[i][j] = min(dp[i][j], 1 + Next[dp[i - 1][j]][L[i - 1]]);
          if (j && dp[i][j - 1] < n)
            dp[i][j] = min(dp[i][j], 1 + Next[dp[i][j - 1]][R[j - 1]]);
        }
      }
      good |= dp[l][r] <= n;
    }
    cout << (good ? "YES\n" : "NO\n");
  }
  return 0;
}
