WA - RRECIPE

Hi,
I have been getting a WA for the solution of Recipe Reconstruction. The code can be found here http://www.codechef.com/viewsolution/3913508.
Tried the basic test cases in the question and some of my own. Seems to working fine. Have I missed something ?

Hve you tried reading this ??

Hi I read the editorial. Infact I just found a similar query and got the solution and the code got AC. It was about overflow.
Instead of ctr = ctr * 26 , it was suppose to be ctr =(ctr * 26)%10000009