Balancing the presents

There are two kids that receive presents. You would like to make sure no one gets envy, so you would like to determine which presents to gift to the first one and the second one so that they finally receive all the same presents.
The input has two lines - the first line has the presents already ready for the first kid separated by a comma and a space (, ), while the second line has the presents ready for the second kid separated by a comma and a space (, ).
The output of the program should have two lines - the first line should contain the presents needed for the first kid separated by a comma and a space, and the second line should contain the presents for the second kid separated by a comma and a space.
Input
Output
lego, transformers, car white t-shirt, lego
white t-shirt transformers, car
 

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue