#include using namespace std; typedef long long int ll; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; map mp; map mpp; for(char c='2';c<='9';c++){ mp[c]=c-'0'; } mp['A']=1; mp['T']=10; mp['J']=11; mp['Q']=12; mp['K']=13; mpp['D']=0; mpp['C']=1; mpp['H']=2; mpp['S']=3; vector s(n); for(int i=0;i> s[i]; } sort(s.begin(), s.end(),[&](auto i,auto j){ if(mpp[i[0]]!=mpp[j[0]])return mpp[i[0]]