Problem regarding backtracking

Please help me regarding this
I m unable to understand how the output is coming??