Finding out the final product
Lets see this step-by-step. 

Bromocyclohexane is reacted with alcoholic KOH. This, as you would know, results in the formation of an alkene by elimination reaction. Product P would be Cyclohexene. 

Cyclohexene is heated with KMnO4. You might think a cis-1,2-cyclohexanediol would form, and indeed it does. But vigorous oxidation provided by the heat cleaves the C-C bond between the two hydroxy groups and essentially converts into 1,6-hexanedioic acid (product Q, a.k.a adipic acid). 

Calcium Oxide, being a pretty strong base,  reacts with the dicarboxylic acid and forms a saltcalcium adipate (product R)

Heating a calcium salt of any carboxylic acid results in the elimination of a $\ce{CaCO3}$ molecule, and forms a ketone. If you take calcium adipate, upon heating would give cyclopentanone(product S). 

Now, cyclopentanone, just like any other carbonyl compound with α-hydrogens, undergoes an aldol reaction, heating which would result in the formation of the compound given in option (B). 

Here is the complete reaction mechanisms: