Every day, Mike goes to his job by a bus, where he buys a ticket. On the ticket, there is a letter-code that can be represented as a string of upper-case Latin letters.
Mike believes that the day will be successful in case exactly two different letters in the code alternate.  Otherwise, he believes that the day will be unlucky. Please see note section for formal definition of alternating code.
You are given a ticket code. Please determine, whether the day will be successful for Mike or not. Print "YES" or "NO" (without quotes) corresponding to the situation.

-----Input-----
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
The first and only line of each test case contains a single string S denoting the letter code on the ticket.

-----Output-----
For each test case, output a single line containing "YES" (without quotes) in case the day will be successful and "NO" otherwise.

-----Note-----
Two letters x, y where x != y are said to be alternating in a code, if code is of form "xyxyxy...".

-----Constraints-----

- 1 ≤ T ≤ 100
- S consists only of upper-case Latin letters

Subtask 1 (50 points):

- |S| = 2

Subtask 2 (50 points):

- 2 ≤ |S| ≤ 100

-----Example-----
Input:
2
ABABAB
ABC

Output:
YES
NO

Difficulty: EASY

Solutions:
t = int(input(''))
if 1 <= t <= 100:
	for _ in range(t):
		s = input('')
		a = s[0]
		b = s[1]
		flag = 0
		if s.isupper() and 2 <= len(s) <= 100:
			if a != b:
				for i in range(len(s)):
					if i % 2 == 0 and s[i] == a:
						continue
					elif i % 2 == 1 and s[i] == b:
						continue
					else:
						flag = 1
						break
				if flag == 0:
					print('YES')
				else:
					print('NO')
			else:
				print('NO')


for _ in range(int(input())):
	b = input()
	a = set(b)
	if len(a) == 2:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	s = input()
	if len(set(s)) == 2:
		flag = True
		for i in range(len(s) - 1):
			if s[i] == s[i + 1]:
				flage = False
				break
		if flag == False:
			print('NO')
		else:
			print('YES')
	else:
		print('NO')


for t in range(int(input())):
	s = input()
	a = s[0]
	b = s[1]
	f = 1
	if a == b:
		f = 0
	else:
		c = a
		for i in s:
			if i != c:
				f = 0
				break
			if c == a:
				c = b
			else:
				c = a
	if f == 1:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	s = input()
	o = []
	e = []
	for i in range(len(s)):
		if i % 2 == 0:
			e.append(s[i])
		else:
			o.append(s[i])
	if o.count(o[-1]) == len(o) and e.count(e[-1]) == len(e):
		if o[-1] != e[-1]:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
for r in range(t):
	s = input()
	a = set()
	for i in range(len(s)):
		a.add(s[i])
	if len(a) == 2:
		print('YES')
	else:
		print('NO')


t = int(input())
while t != 0:
	s = input()
	l = len(s)
	f = 0
	if l == 2 and s[0] == s[1]:
		f = 1
	for j in range(1, l - 1):
		if s[j] == s[j + 1] or s[j - 1] != s[j + 1]:
			f = 1
			break
	if f == 0:
		print('YES')
	else:
		print('NO')
	t -= 1


for _ in range(int(input())):
	s = input()
	i = 0
	n = len(s)
	if n == 2:
		if s[0] != s[1]:
			print('YES')
		else:
			print('NO')
	else:
		d = {}
		for ele in s:
			d[ele] = 0
		i = 0
		flag = 0
		while i < n - 1:
			if s[i] == s[i + 1]:
				flag = 1
				break
			i += 2
		if len(d) == 2 and flag == 0:
			print('YES')
		else:
			print('NO')


tc = int(input())
for _ in range(tc):
	a = str(input())
	if len(set(a)) == 2:
		print('YES')
	else:
		print('NO')