Devided code on three parts