I am using Drupal 7 and the [Group](https://www.drupal.org/project/group) module. I would like to create reaction rule or some code which automatically signs the user up to group 'blue', when they sign up to group 'red'.

I wouldn't mind using [Rules](https://www.drupal.org/project/rules) or hard coding it. The only thing is that if the user leaves the first group, I want to be able to cancel their membership in the second group too.

What would be the easiest way? I have of course tried Rules without success and I cannot find a simple way to hard code it.