Alice had a bag where each number from 1 to N was present in it. After a magic trick she either removes all even numbers or all odd numbers from the bag. Given the kind of trick she has performed find the P’th smallest number in the bag after the trick. For example P = 1 denotes the smallest number present.
First line contains T, the number of test cases. Each test case consists of N, a string S and an integer P in single line.
S will be either "odd" or "even"(quotes for clarity), denoting the kind of trick Alice has performed.
Note: It is guaranteed that P will be less than or equal to remaining items in the bag.
For each test case print required answer in one line.
*Constraints*
Example 1.
After performing the “odd” trick the numbers 1 and 3 get removed from the bag. Numbers 2 and 4 are left in the bag. 2nd smallest number is 4 now.
Example 2.
After performing the “even” trick the numbers 2 and 4 get removed from the bag. Numbers 1, 3 and 5 are left in the bag. 2nd smallest number is 3 now.
## Input
First line contains T, the number of test cases. Each test case consists of N, a string S and an integer P in single line.S will be either "odd" or "even"(quotes for clarity), denoting the kind of trick Alice has performed.Note: It is guaranteed that P will be less than or equal to remaining items in the bag.
## Output
For each test case print required answer in one line.*Constraints* 1 ≤ T ≤ 100 1 ≤ N ≤ 103
[samples]
## Note
Example 1.After performing the “odd” trick the numbers 1 and 3 get removed from the bag. Numbers 2 and 4 are left in the bag. 2nd smallest number is 4 now.Example 2.After performing the “even” trick the numbers 2 and 4 get removed from the bag. Numbers 1, 3 and 5 are left in the bag. 2nd smallest number is 3 now.
**Definitions**
Let $ T \in \mathbb{Z} $ be the number of test cases.
For each test case $ k \in \{1, \dots, T\} $:
- Let $ N_k \in \mathbb{Z}^+ $ denote the upper bound of the initial set $ \{1, 2, \dots, N_k\} $.
- Let $ S_k \in \{\text{"odd"}, \text{"even"}\} $ denote the type of removal trick.
- Let $ P_k \in \mathbb{Z}^+ $ denote the position of the desired element in the remaining set.
**Constraints**
1. $ 1 \le T \le \text{some upper bound (not specified)} $
2. $ 1 \le N_k \le \text{some upper bound (not specified)} $
3. $ 1 \le P_k \le \text{number of remaining elements after removal} $
**Objective**
For each test case $ k $, define the remaining set $ R_k \subseteq \{1, 2, \dots, N_k\} $ as:
$$
R_k =
\begin{cases}
\{ x \in \{1, \dots, N_k\} \mid x \text{ is odd} \} & \text{if } S_k = \text{"even"} \\
\{ x \in \{1, \dots, N_k\} \mid x \text{ is even} \} & \text{if } S_k = \text{"odd"}
\end{cases}
$$
Let $ r_{k,1} < r_{k,2} < \dots < r_{k,|R_k|} $ be the sorted elements of $ R_k $.
Compute and output $ r_{k,P_k} $.