Solution to Cats vs Dogs