Solving complex problems by composing simple solutions using GNNs