#include <iostream> #include <string> #include <map> using namespace std; int main() { int n; cin >> n; // 构建对称字符映射表 map<char, char> sym_map; string self_sym = "ilmnouvwx"; for (char c : self_sym) { sym_map[c] = c; } sym_map['b'] = 'd'; sym_map['d'] = 'b'; sym_map['p'] = 'q'; sym_map['q'] = 'p'; while (n--) { string s; cin >> s; bool is_symmetric = true; int left = 0, right = s.length() - 1; while (left <= right) { // 检查当前字符是否在映射表中,且是否与对应位置的字符满足对称关系 if (sym_map.find(s[left]) == sym_map.end() || sym_map[s[left]] != s[right]) { is_symmetric = false; break; } left++; right--; } cout << (is_symmetric ? "Yes" : "No") << endl; } return 0; }