I went through AC submissions and could not figure out why my solution fails.
Here is the link-
My WA code
I think there is some problem with taking string as input in queries, though it works fine on Codechef IDE. It would be great if someone can help me out.
I could not find an announcement for this contest, so if any of the organizers are reading this. IMO it was very stupid to have queries like x = c or y = c. Could have been simply done as type 1 or 2. It makes me feel as if it was deliberately done so that people are stuck in implementation (thinking about the solution was pretty easy). You can do that, you are the organizers but doing it so that the contest seems to have a nice difficulty curve is very stupid (I could not think of any other explaination to this).