In the 19th century, blood transfusions were a very risky undertaking. Patients could of course survive the procedure, but the number of deaths was extremely high. For this reason, blood transfusions were only carried out in cases of extreme loss of blood, if there were no other possibilities to save the life of the patient. In 1900, Austrian scientist Karl Landsteiner discovered the reason for the high number of deaths. There are namely different blood groups and when mixed, the red blood cells could clump together. Landsteiner received the Nobel prize in 1930 for Physiology and Medicine. By taking a sample of blood from donor and recipient before a transfusion and comparing the blood groups, blood transfusions became a lifesaving procedure.

bloedgroep

Every person's blood contains two markers that are called ABO alleles. Each of these markers is represented by one of the following letters: A, B or O. This way, each person can have one of six combinations of alleles, that result in a certain ABO blood group for this person as given in the table below.

crossing ABO blood group
A and A A
A and B AB
A and O A
B and B B
B and O B
O and O O

Completely analogous, every person's blood contains two alleles for the Rhesus factor. This Rhesus factor is represented by the characters + and -. A person that is Rhesus positive, has at least one + allele but can also have two. A person that is Rhesus negative, always has two - alleles. This is illustrated in the table below.

crossing rhesus factor
+ and + +
+ and - +
- and - -

A person's blood group is determined by the combination of the ABO blood group and the Rhesus factor. This blood group is written as the letter combination of the ABO blood group, followed by the plus or minus that represents the Rhesus factor. E.g. A+, AB- and O-.

Bloodgroups are inherited: every biological parent gives one ABO allel (randomly chosen of out the two) and one rhesus allele to his/her child. For example, assume that both parents of a child have bloodgroup A-, then the child can either have bloodgroup A- or bloodgroup O-. A child with parents with bloodgroup A+ and B+ can have any possible bloodgroup.

Assignment

For this assignment you get the blood groups of two parents or those of a parent and his or her child. Based on this data you must determine the (possibly empty) collection of all possible blood groups a child or another parent can have.

Note: For this problem, the uppercase letter O is used for the notation of blood groups, not the digit 0 (zero).

Example

>>> bloodgroup_child('O+', 'O-')
{'O+', 'O-'}
>>> bloodgroup_child('O-', 'O-')
{'O-'}
>>> bloodgroup_child('AB-', 'AB+')
{'A+', 'A-', 'AB+', 'AB-', 'B+', 'B-'}

>>> bloodgroup_parent('O+', 'O-')
{'A-', 'A+', 'B-', 'B+', 'O-', 'O+'}
>>> bloodgroup_parent('AB+', 'O+')
set()