A panda accidentally wandered into my cow pen, and when I tried to get it out, another one got in too.

How do I get them out?
What do I do now? :(