Help me in solving LB02B problem

My issue

I didn’t understand this concept of having legs basis of given example

Learning course: Solve Programming problems using Python
Problem Link: CodeChef: Practical coding for everyone

@mishrapragya26
The logic is if z%x==0 and z%y==0 then the answer would be any.
If only z%x==0 then the answer would be chicken.
if only z%y==0 then the answer would be duck.
else case answer would be none.