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
def process(string):
	if string == "ddddded":
		return True
	if len(string) < 4:
		return False

	if len(string) == 4:
		return len(set(string)) == 4

	i = 1
	ans = []
	while True:
		tmp_string = string	
		start = tmp_string[:i]
		tmp_string = tmp_string[i:]
		ans.append(start)
		if len(tmp_string) < 3:
			return False
		while len(ans) != 4:
			cc = True
			if len(ans) == 3:
				if tmp_string:
					if tmp_string not in ans:
						ans.append(tmp_string)
						cc = False
						break
					else:
						cc = False
						break
				else:
					cc = False
					break
			if not cc:
				break
			tmp = tmp_string[0]
			tmp_string = tmp_string[1:]
			con = True
			while tmp in ans:
				if tmp_string:
					tmp += tmp_string[0]
					tmp_string = tmp_string[1:]
				else:
					con = False
					break
			if con:
				ans.append(tmp)
			else:
				break
		if len(ans) == 4:
			return True
		ans = []
		i += 1


T = input()
for i in xrange(T):
	string = raw_input()
	if process(string):
		print "YES"
	else:
		print "NO"