A. Palindromic Twist

You are given a string ss consisting of nn lowercase Latin letters. nn is even.

For each position ii (1≤i≤n1≤i≤n) in string ss you are required to change the letter on this position either to the previous letter in alphabetic order or to the next one (letters 'a' and 'z' have only one of these options). Letter in every position must be changed exactly once.

For example, letter 'p' should be changed either to 'o' or to 'q', letter 'a' should be changed to 'b' and letter 'z' should be changed to 'y'.

That way string "codeforces", for example, can be changed to "dpedepqbft" ('c' →→ 'd', 'o' →→ 'p', 'd' →→ 'e', 'e' →→ 'd', 'f' →→ 'e', 'o' →→'p', 'r' →→ 'q', 'c' →→ 'b', 'e' →→ 'f', 's' →→ 't').

String ss is called a palindrome if it reads the same from left to right and from right to left. For example, strings "abba" and "zz" are palindromes and strings "abca" and "zy" are not.

Your goal is to check if it's possible to make string ss a palindrome by applying the aforementioned changes to every position. Print "YES" if string ss can be transformed to a palindrome and "NO" otherwise.

Each testcase contains several strings, for each of them you are required to solve the problem separately.

Input

The first line contains a single integer TT (1≤T≤501≤T≤50) — the number of strings in a testcase.

Then 2T2T lines follow — lines (2i−1)(2i−1) and 2i2i of them describe the ii-th string. The first line of the pair contains a single integer nn (2≤n≤1002≤n≤100, nn is even) — the length of the corresponding string. The second line of the pair contains a string ss, consisting of nnlowercase Latin letters.

Output

Print TT lines. The ii-th line should contain the answer to the ii-th string of the input. Print "YES" if it's possible to make the ii-th string a palindrome by applying the aforementioned changes to every position. Print "NO" otherwise.

Example

input

5
6
abccba
2
cf
4
adfa
8
abaazaba
2
ml

output

YES
NO
YES
NO
NO

 

题意:判断一个字符串在每个字母都变成其相邻字母的情况下能否构成回文串。

代码:

#include<iostream>
#include<algorithm>
#include<cstring>
#include<string>
#include<cstdio>
#include<cmath>
#include<set>
#include<map>
using namespace std;
#define inf 0x3f3f3f3f
#define ll long long
#define closeio std::ios::sync_with_stdio(false)
 
int main()
{
	int t,n,i,flag,x,y,x1,x2,y1,y2;
	string a;
	cin>>t;
	while(t--)
	{
		flag=0;
		cin>>n;
		cin>>a;
		for(i=0;i<n/2;i++)
		{
			x=a[i]-'a';
			y=a[n-i-1]-'a';
			//cout<<x<<" "<<y<<endl;
			x1=x-1;
			x2=x+1;
			y1=y-1;
			y2=y+1;
			if(x1!=y1&&x1!=y2&&x2!=y1&&x2!=y2)
				flag=1;
		}
		if(flag)
		cout<<"NO"<<endl;
		else
		cout<<"YES"<<endl;
	} 
	return 0;
}