Well, it's a very simple task.#4503

Well, it's a very simple task.

1 second
32 megabytes
Very easy

You are tasked with a straightforward problem involving bitwise operations. Given a number and a specified operation type, you need to compute the resulting value as follows:

  1. ...

    , if the operation is bitwise AND, denoted by "".

  2. ...

    , if the operation is bitwise OR, denoted by "".

Input

The input consists of multiple test cases. The first line contains the integer , representing the number of test cases, where 1 \leq T \leq 10^4. Each of the following lines contains two values: the type of operation (OR or AND) and the number , where 1 \leq N \leq 10^{100}.

Output

For each test case, output the result on a new line.

Examples

Example 1

Loading
Loading