For this Question: Ronaldo has challenged Messi to beat his team in the upcoming “Friendly” fixture. But both these legends are tired of the original football rules, so they decided to play Football with a twist. Each player is assigned an ID, from 1 to 10^6. Initially Ronaldo has the ball in his posession. Given a sequence of N passes, help Messi Know which ID player has the ball, after N passes.

Note: Passes are of two types :

i) P ID, which means the player currently having the ball passes it to Player with identity ID.
ii) B, which means the player currently having the ball passes it back to the Player he got the Pass From.

Also, It is guaranteed that the given order of passes will be a valid order.The first line of input contains number of testcases T. The 1st line of each testcase, contains two integers, N and ID1, denoting the total number of passes and the ID of Ronaldo. Respectively. Each of the next N lines, contains the information of a Pass which can be either of the above two types, i.e:

1) P ID
2) B

Constraints
1 <= T <= 100
1 <= N <= 10^5
1 <= IDs <= 10^6
Sum of N for every test case is less than 10^6For each testcase you need to print the ID of the Player having the ball after N passes.Input :
2
3 1
P 13
P 14
B
5 1
P 12
P 13
P 14
B
B

Output :
13
14

Explanation :
Testcase 1: Initially, the ball is with Ronaldo, having ID 1.
In the first pass, he passes the ball to Player with ID 13.
In the Second Pass, the player currently having the ball, ie Player with ID 13, passes it to player with ID 14.
In the last pass the player currently having the ball, ie Player with ID 14 passed the ball back to the player from whom he got the Pass, i.e the ball is passed back to Player with Player ID 13, as Player ID 13 had passed the ball to player ID 14 in the previous pass.

Testcase 2: Initially, the ball is with Ronaldo, having ID 1.
In the first pass he passes the ball to player with ID 12.
In the second pass, the second player passes the ball to palyer with ID 13, again the player with ID 13 passes the ball to player with ID 14. 
Now, player with ID 14 passed back the ball to 13, and again 13 passes back the ball to 14., I have written this Solution Code:  #include "bits/stdc++.h"
 #pragma GCC optimize "03"
 using namespace std;
  
 #define int long long int
 #define ld long double
 #define pi pair<int, int>
 #define pb push_back
 #define fi first
 #define se second
 #define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
 #ifndef LOCAL
 #define endl '\n'
 #endif
  
 const int N = 2e5 + 5;
 const int mod = 1e9 + 7;
 const int inf = 1e9 + 9;
 
 signed main() {
 	IOS;
 	int t;	cin >> t;
 	while(t--){
 		int n, id;	cin >> n >> id;
 		int pre = 0, cur = id;
 		for(int i = 1; i <= n; i++){
 			char c;	cin >> c;
 			if(c == 'P'){
 				int x;	cin >> x;
 				pre = cur;
 				cur = x;
 			}	
 			else{
 				swap(pre, cur);
 			}
 		}
 		cout << cur << endl;
 	}	
 	return 0;
 }, In this Programming Language: C++, Now tell me if this Code is compilable or not?