why i'm getting runtime error(NZEC) in my python code which is running without any errors in my system and giving right results in my system?

test = int(input())

for i in range(test):
    s = input()
    ate = 0
    snakes = 0
    mongoose = 0
    count = 0
    for i in s:
        if s[count] == 'm':
            mongoose += 1
            if(s[count-1] == 's'):
                ate+= 1
            elif (s[count+1] == 's'):
                ate +=1
        else:
            snakes +=1
        count += 1
        snakes -= ate
    if snakes > mongoose:
        print("snakes")
    elif mongoose > snakes:
        print("mongooses")
    else:
        print("tie")