Solution to Game of Thrones - I problem.