def canRiotAPC(queue):
    t_q = [i['type'] for i in queue]
    return t_q.count('Wheel') >= 4 and t_q.count('Body') >= 1 and t_q.count('WaterCannon') >= 1

def isRiotAPC(queue):
    if canRiotAPC(queue):
        toremove = ['Wheel','Wheel','Wheel','Wheel','Body','WaterCannon']
        while toremove:
            tofind = toremove.pop()
            for idx, it in enumerate(queue):
                if (it['type'] == tofind):
                    break
            del queue[idx]
        return True

def canWarAPC(queue):
    t_q = [i['type'] for i in queue]
    return t_q.count('Tracks') >= 2 and t_q.count('Body') >= 1 and t_q.count('MachineGun') >= 1
        
def isWarAPC(queue):
    if canWarAPC(queue):
        toremove = ['Tracks','Tracks','Body','MachineGun']
        while toremove:
            tofind = toremove.pop()
            for idx, it in enumerate(queue):
                if (it['type'] == tofind):
                    break
            del queue[idx]
        return True