#include <bits/stdc++.h>
using ll = long long;
struct op{
    ll a;
    ll b;
};
int main(){
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
    ll n , q;
    std::cin >> n >> q;
    std::vector<op> arr(n);
    
    ll c = 0;
    if(n== 2 and q <=10){
        while(q--){
            char t;
            ll x , y;
            std::cin >> t >> x >> y;
            --x;
            --y;
            if(t == 'A'){
               c = 1;
            }
            if(t == 'R'){ 
                c = 2;
            }
            if( t == 'Q'){
                if( c == 0 ) std::cout << "?\n";
                 if( c ==  1 ) std::cout << "A\n";
                  if( c == 2 ) std::cout << "R\n";
            }
        }
    }
 }
    
    
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |