Problem: 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

Solution (in PYTHON):

Solution:
def checkString(str1,str2,str3,str4):
	if(str1 == str2):
		# print "str1 == str2"
		return False
	elif(str1 == str3):
		# print "str1 == str3"
		return False
	elif(str1 == str4):
		# print "str1 == str4"
		return False
	elif(str2 == str3):
		# print "str2 == str3"
		return False
	elif(str2 == str4):
		# print "str2 == str4"
		return False
	elif(str3 == str4):
		# print "str3 == str4"
		return False
	else:
		# print "All different"
		return True

tc = int(raw_input())
for i in xrange(tc):
    myString = raw_input()
    str1=""
    str2=""
    str3=""
    str4=""
    N = len(myString)
    for a in xrange(1,N-2):
        if(checkString(str1,str2,str3,str4)):
            # print "breaking at a loop"
            break
        for b in xrange(1,N-2):
            if(checkString(str1,str2,str3,str4)):
                # print "breaking at b loop"
                break
            for c in xrange(1,N-2):
                if(checkString(str1,str2,str3,str4)):
                    # print "breaking at c loop"
                    break
                for d in xrange(1,N-2):
                    if(checkString(str1,str2,str3,str4)):
                        # print "breaking at d loop"
                        break
                    if((a+b+c+d)==N):
                        str1=myString[0:a]
                        str2=myString[a:a+b]
                        str3=myString[a+b:a+b+c]
                        str4=myString[a+b+c:]
                        if(checkString(str1,str2,str3,str4)):
                            break
    # print "I reached for final test"
    if(checkString(str1,str2,str3,str4)):
        print "YES"
        # print "str1",str1
        # print "str2",str2
        # print "str3",str3
        # print "str4",str4
    else:
        print "NO"