Help me in solving LB02B problem

My issue

These Farm Animals Problem i did not understand H ow to solve .

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

The logic is quite simple if z%x==0 and z%y==0 print any.
if only z%x==0 print chicken.
if only z%y==0 print duck.
else print none.