Codeforces Cycles

Can anyone explain the editorial here for this problem??
I didn’t get anything out of it…