#include <bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ int ja[10]={0},jb[10]={0},ya[10]={0},yb[10]={0}; char j,y; for(int i=1;i<=n;i++){ cin>>j>>y; // cout<<j<<" "<<y<<endl; if(j==y){ //平局 ja[2]++; ya[2]++; // cout<<"平局"; }else if(j==‘C‘ && y==‘J‘ || j==‘B‘&&y==‘C‘ || j==‘J‘&&y==‘B‘){ //甲赢 ja[1]++; ya[3]++; if(j==‘B‘) jb[1]++; if(j==‘C‘) jb[2]++; if(j==‘J‘) jb[3]++; // cout<<"甲赢"; }else{ //乙赢 ja[3]++; ya[1]++; if(y==‘B‘) yb[1]++; if(y==‘C‘) yb[2]++; if(y==‘J‘) yb[3]++; // cout<<"乙赢"; } } cout<<ja[1]<<" "<<ja[2]<<" "<<ja[3]<<endl; cout<<ya[1]<<" "<<ya[2]<<" "<<ya[3]<<endl; if(jb[1]>=jb[2] && jb[1]>=jb[3]){ cout<<"B"; }else if(jb[2]>jb[1] && jb[2]>=jb[3]){ cout<<"C"; }else{ cout<<"J"; } cout<<" "; if(yb[1]>=yb[2] && yb[1]>=yb[3]){ cout<<"B"; }else if(yb[2]>yb[1] && yb[2]>=yb[3]){ cout<<"C"; }else{ cout<<"J"; } } }