Something like , a method that gets a map <String,String> that define relations only if you got a mirroring relations ex the map contains: X:Y, and Y:X or not <A,B> and you get a Map of <String,Integer> for each char with its score ex: <X,5> ,<Y,6> ,<A,1> <B,2> and you need to write out the score of each char, and if it has a mirroring you should write also its sibling. ex: <x,<5,6>> , <Y,<5,6>> , <A,1> , <B,2> Note that the relation can be recursively ex: <X,Z> and <Z,X> in this case you should combine <X,Y,Z>