Help me in solving LB02A problem

My issue

My code

# Step 1: Read and understand the problem statement and sample test cases

# Click on 'Next' once you are ready to proceed.
    for i in range(t):

Learning course: Python for problem solving - 1
Problem Link: CodeChef: Practical coding for everyone

The logic is if z%x==0 and z%y==0 then answer is any and if only z%x==0 then answer is chicken if only z%y==0 then answer is ducks else answer is any.