#include <iostream>
#include <string>
using namespace std;
#include<vector>
int main() {
int n;
cin >> n;
vector<string> str;
string D,T,A,J,Q,K;
D = "DX";
K ="KKKK";
T = "TTTT";
A = "AAAA";
J = "JJJJ";
Q = "QQQQ";
K = "KKKK";
for (int i = 0; i < n; i++)
{
string m;
cin >> m;
str.push_back(m);
}
for (int i = 0; i < n; i++)
{
if (
(str[i].find(D) == -1)&&
(str[i].find(T) == -1)&&
(str[i].find(A) == -1)&&
(str[i].find(2222) == -1) &&
(str[i].find(3333) == -1)&&
(str[i].find(4444) == -1) &&
(str[i].find(5555) == -1) &&
(str[i].find(6666) == -1)&&
(str[i].find(7777) == -1)&&
(str[i].find(8888) == -1)&&
(str[i].find(9999) == -1)&&
(str[i].find(J) == -1)&&
(str[i].find(Q) == -1)&&
(str[i].find(K) == -1))
{
cout << "No"<<endl;
}
else {
cout << "Yes"<<endl;
}
}
return 0;
}
```vs上运行结果对啊