Splitting program in three sections