Thanks for your response i have solved it successfully.
Full text and comments »
CF Edu Round 173 Solution Discussion