Kevin has a string S consisting of N lowercase English letters.  

Kevin wants to split it into 4 pairwise different non-empty parts.  For example, string "happynewyear" can be splitted into "happy", "new", "ye" and "ar". He can't delete any characters or change the order of the characters.

Help Kevin and find if there exist at least one possible spliting.

Input format:

The first line of input will contain an integer T, denoting the number of test cases. Each of the next T lines contains a string S.

Output format:

For every test case output "YES" if it is possible to split the string and "NO" otherwise.

Constraints:
1 ≤ T ≤ 100
1 ≤ N ≤ 1000
N ≤ 20 in test data worth 40% of all points

SAMPLE INPUT
2
ababca
aaabb

SAMPLE OUTPUT
YES
NO
for _ in range(int(raw_input())):
	a=raw_input()
	if len(a)<=3:
		print 'NO'
		continue
	elif len(a)>=10:
		print 'YES'
		continue
	else:
		flag=0
		for i in range(len(a)-3):
			for j in range(i+1,len(a)-2):
				for k in range(j+1,len(a)-1):
					a1=a[0:i+1]
					a2=a[i+1:j+1]
					a3=a[j+1:k+1]
					a4=a[k+1:len(a)]
					if a1!=a2 and a1!=a3 and a1!=a4 and a2!=a3 and a2!=a4 and a3!=a4:
						flag=1
						break
				if flag:
					break
			if flag:
				break
		if flag:
			print 'YES'
		else:
			print 'NO'