Solve swap nodes in pairs