WA in REBIT

I applied a divide and conquer strategy to this problem.
The expression is divided into smaller sub sections and solved.The solution of each is combined to get the final result.
For the test set shown below…i am getting a wrong answer

2
(((#^#)|(#&#))&((#&#)^#))
((#|#)|#)

Correct output
526417921 900759553 783777793 783777793
857866241 233963521 889061377 889061377

My output
526417921 900759553 783777793 783777793
982646785 233963521 889061377 889061377

Gone through the code several times…But unable to find the mistake :sneezing_face:

This is the link to my code
https://www.codechef.com/viewsolution/31870565

Please help me out