According to the problem, if I click any place(x) then the up, down, left and the right side will toggle with the corresponding x.( if it’s on then it will off and vice versa ) This game is a better representation of what this problem saying.
But if we look at the first example then it is,
Input: