You would ask guard A if guard B would say the door guard B is guarding leads to life. If the answer is "yes", then guard B is guarding the door to life, and if the answer is "no", then guard A is guarding the door to life.