solve swap nodes in pairs