#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
string x;
cin >> x;
string ans;
for(int i = 0 ; i < 2*n ; i=i+2)
{
int p1=-1;
int p2=-1;
int b[4]={1,1,1,1};
b[x[i]-'A']=0;
b[x[i+1]-'A']=0;
for(int j = 0 ; j < 4 ; ++j )
{
if(b[j]==1)
{
if(p1 == -1)
p1 = j;
else
p2 = j;
}
}
ans+=(p1+'A');
ans+=(p2+'A');
if(ans[i] == ans[i-1])
swap(ans[i],ans[i+1]);
}
cout << ans << endl;
return 0;
}
using namespace std;
int main(){
int n;
cin >> n;
string x;
cin >> x;
string ans;
for(int i = 0 ; i < 2*n ; i=i+2)
{
int p1=-1;
int p2=-1;
int b[4]={1,1,1,1};
b[x[i]-'A']=0;
b[x[i+1]-'A']=0;
for(int j = 0 ; j < 4 ; ++j )
{
if(b[j]==1)
{
if(p1 == -1)
p1 = j;
else
p2 = j;
}
}
ans+=(p1+'A');
ans+=(p2+'A');
if(ans[i] == ans[i-1])
swap(ans[i],ans[i+1]);
}
cout << ans << endl;
return 0;
}
condition : if(ans[i] == ans[i-1])
ReplyDeletefor i == 0, this may raise exception