I am replacing two smoke detectors that are on the same breaker. I have three wires,one white one black and one red. How do I connect them?

John