Context-free pairs of groups I: context-free pairs and graphs