Learning retrosynthetic planning through self-play