#include <string>
#include <vector>
using namespace std;
int alpha[40];
int score[4][2];
string solution(vector<string> survey, vector<int> choices) {
string answer = "";
for(int i=0;i<survey.size();i++){
int front = survey[i][0] - 'A';
int back = survey[i][1] - 'A';
if(choices[i]<=3){
if(choices[i] == 3){
choices[i] = 1;
}else if(choices[i] == 1){
choices[i] = 3;
}
alpha[front] +=choices[i];
}else if(choices[i] > 4){
choices[i] -=4;
alpha[back]+= choices[i];
}
}
if(alpha['R'-'A'] >= alpha['T'-'A']){
answer+='R';
}else{
answer+='T';
}
if(alpha['C'-'A'] >= alpha['F'-'A']){
answer+='C';
}else{
answer+='F';
}
if(alpha['J'-'A'] >= alpha['M'-'A']){
answer+='J';
}else{
answer+='M';
}
if(alpha['A'-'A'] >= alpha['N'-'A']){
answer+='A';
}else{
answer+='N';
}
return answer;
}