|All-time Popular Problems|
|Delete without head pointer|
|Check if a number is power of another number|
|Array to BST|
|Implement Queue using Linked List|
|Lowest Common Ancestor in a BST|
|Reverse a Linked List in groups of given size.|
|Print all nodes that don’t have sibling|
|Equal to product|
Given a string consisting of only 0, 1, A, B, C where
A = AND
B = OR
C = XOR
Calculate the value of the string assuming no order of precedence and evaluation is done from left to right.
The first line of input contains an integer T denoting the number of test cases.
The next T lines contains T strings.
Print the value of the string assuming no order of precedence and evaluation is done from left to right
1 ≤ T ≤ 100
1 ≤ length(string)<=1000
Output : 1
1 AND 0 OR 1 = 1