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:
noi=input()

for i in range(0,noi):
    str=raw_input()
    breakall=False
    for f1 in range(0,len(str)):
        for f2 in range(f1+1,len(str)):
            for f3 in range(f2+1,len(str)-1):
                map={}
                s1=str[:f1+1]
                map[s1]=1
                s2=str[f1+1:f2+1]
                map[s2]=1
                s3=str[f2+1:f3+1]
                map[s3]=1
                s4=str[f3+1:]
                map[s4]=1
                if len(map) == 4:
                    print "YES"
                    breakall = True
                    break
            if breakall:
                break
        if breakall:
            break
    else:
        print("NO")