SIGABRT in TAEDITOR

I dont know why I am getting a SIGABRT(RE) in the problem Simple Editor.
Problem link : http://www.codechef.com/problems/TAEDITOR
My submitted program : http://www.codechef.com/viewsolution/4392349

Help appreciated.