I got partially correct answer in KCHAR. EDIT : Got AC. Thanks to @abhikalpu_123 and @raj79 for help. Appreciate it! Thanks! asked 05 Jul '17, 14:13

Answer is hidden as author is suspended. Click here to view.
answered 05 Jul '17, 14:29
Ya I know, Thanks! Well I found a pattern for all indexes. All even index(say k) have same character as their (better) halves :p (i.e k/2). Now for odd index, the character at odd index is different from the difference of character at the next greatest power of 2 and the index(i.e p(power of 2>k)  k). And then I ran a recursive function to find the answer. I know I am bad at explaining but I tried my best!!
(05 Jul '17, 14:48)
i guess you are complicating things enough in your code , and this will not be running for 10e18 as @abhikalpu_123 said. your logic is right , but it fails at higher values. while(n%2==0) n/=2; if (n%4==1) print a else print c, it was as simple as that , an overview of your logic actually. i did the same as your logic , but in a normal while loop. this will eazily run , just use long long int
(05 Jul '17, 14:56)
I just had a array 1 size smaller as @abhikalpu_123 pointed out!! Got AC now.. Thanks for the help though :)
(05 Jul '17, 15:06)

The max value of K can be up to 10^18 But your code is handling up to 2^59 i.e. 5*10^17. In your above code make increase the length of array $a$ to 61 instead of 60. (and corresponding changes like making every for loop i<61). As @raj97 said its quite tough but im in a vaccation :D answered 05 Jul '17, 14:48
Or simply, find and replace 61 by 60. :P
(05 Jul '17, 14:51)
Thanks for analysis of the code :) Urghh when will I stop making small mistakes! Thanks for the help man... Appreciate it :)
(05 Jul '17, 14:57)
