Cain delivers in vintage style as Giants beat Cubs