Catherine has a deck of n cards, each of which is either red, green, or blue. As long as there are at least two cards left, she can do one of two actions:   take any two (not necessarily adjacent) cards with different colors and exchange them for a new card of the third color;  take any two (not necessarily adjacent) cards with the same color and exchange them for a new card with that color. She repeats this process until there is only one card left. What are the possible colors for the final card?

The first line of the input contains a single integer n (1 ≤ n ≤ 200) — the total number of cards. The next line contains a string s of length n — the colors of the cards. s contains only the characters 'B', 'G', and 'R', representing blue, green, and red, respectively.

Print a single string of up to three characters — the possible colors of the final card (using the same symbols as the input) in alphabetical order.

NoteIn the first sample, Catherine has one red card and one blue card, which she must exchange for a green card.In the second sample, Catherine has two green cards and one red card. She has two options: she can exchange the two green cards for a green card, then exchange the new green card and the red card for a blue card. Alternatively, she can exchange a green and a red card for a blue card, then exchange the blue card and remaining green card for a red card.In the third sample, Catherine only has blue cards, so she can only exchange them for more blue cards.

#include<cstdio>
#include<iostream>
#include<cstring>
#include<vector>
#include<map>
#include<cmath>
#include<queue>
#include<set>
#include<algorithm>

using namespace std;
const int N=100001;
#define M 101
struct node{
	long long int a,b;
};
node ang[N];
node anb[N];
bool cmp1(node x,node y){
  return x.a<y.a;
}
bool cmp(int a,int b){
	return a>b;
}

int main(){
	int n;
	char a[201];
	cin>>n;
	cin>>a;
	int r=0,g=0,b=0;
	for (int i = 0; i < n; i++)
	{
		if (a[i]=='R') r++;
		else if(a[i]=='G') g++;
		else b++;
	}
	if(r>0&&g==0&&b==0) cout<<"R"<<endl;
    else if(r==0&&g>0&&b==0)  cout<<"G"<<endl;
        else if(r==0&&g==0&&b>0)  cout<<"B"<<endl;
        else if(r==0&&g==1&&b==1)  cout<<"R"<<endl;
        else if(r==1&&g==0&&b==1)    cout<<"G"<<endl;
        else if(r==1&&g==1&&b==0) cout<<"B"<<endl;
        else
        {
            if(r>1)
            {
                if(g==1&&b==0)  cout<<"BG"<<endl;
                else if(g==0&&b==1)  cout<<"BG"<<endl;
                else cout<<"BGR"<<endl;
            }
            else if(g>1)
            {
                if(r==1&&b==0)    cout<<"BR"<<endl;
                else if(r==0&&b==1)  cout<<"BR"<<endl;
                else  cout<<"BGR"<<endl;
            }
            else if(b>1)
            {
                if(g==1&&r==0)   cout<<"GR"<<endl;
                else if(g==0&&r==1)   cout<<"GR"<<endl;
                else   cout<<"BGR"<<endl;
            }
            else
               cout<<"BGR"<<endl;
	  }

	cin>>n;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
string arr;
cin>>arr;
sort(arr.begin(), arr.end());
set<char> si;
map<int, int> mp;
for(int i=0; i<arr.size(); i++){
    si.insert(arr[i]);
    mp[arr[i]]++;
}
if(si.size()==3)
    cout<<"BGR";
else if(si.size()==1)
    cout<<arr[0];
else{
    if(mp[arr[0]]>=2 && mp[arr[n-1]]>=2){
        cout<<"BGR";
        return 0;
    }
    set<char> hi;
    hi.insert('B');
    hi.insert('R');
    hi.insert('G');
    hi.erase(arr[0]);
    hi.erase(arr[n-1]);
    vector<char> vc;
    if(mp[arr[0]]<mp[arr[n-1]]){
        vc.push_back(arr[0]);
        vc.push_back(*hi.begin());
    }
    else if(mp[arr[0]]==mp[arr[n-1]])
        vc.push_back(*hi.begin());
    else{
        vc.push_back(arr[n-1]);
        vc.push_back(*hi.begin());
    }
    sort(vc.begin(), vc.end());
    for(int i=0; i<vc.size(); i++)
        cout<<vc[i];
}
return 0;
}

#include <bits/stdc++.h>
using namespace std;

int n;
char ch[201];
int G = 0, R = 0, B = 0;

int main() {
    scanf("%d", &n);
    scanf("%s", &ch);
    for(int i = 0; ch[i]; ++i) {
        switch(ch[i]) {
            case 'R': R++; break;
            case 'B': B++; break;
            case 'G': G++; break;
        }
    }
    if(R && B && G) {
        printf("BGR");
        return 0;
    }
    if((R >= 2 && B >= 2) || (R >= 2 && G >= 2) || (B >= 2 && G >= 2)) {
        printf("BGR");
        return 0;
    }
    if(R && !B && !G) {
        printf("R");
        return 0;
    }
    if(!R && B && !G) {
        printf("B");
        return 0;
    }
    if(!R && !B && G) {
        printf("G");
        return 0;
    }
    if(R == 1 && B == 1 && !G) {
        printf("G");
        return 0;
    }
    if(R == 1 && G == 1 && !B) {
        printf("B");
        return 0;
    }
    if(!R && B == 1 && G == 1) {
        printf("R");
        return 0;
    }
    if(R >= 2 && (G || B)) {
        printf("BG");
        return 0;
    }
    if(G >= 2 && (R || B)) {
        printf("BR");
        return 0;
    }
    if(B >= 2 && (R || G)) {
        printf("GR");
        return 0;
    }
    return 0;
}

#include <iostream>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <string>

typedef long long ll;
const ll INF = 1e15;
using namespace std;
string s;

ll getcol(ll a) {
	ll ret = 0;
	ret = a / 3 + a / 2 - a / 6;
	return ret;
}

int main() {
	ll n,m;
	cin >> n;
	cin >> s;
	set<char> st;
	ll r = 0, g = 0, b = 0;
	for (ll i = 0; i < n; i++) {
		if (s[i] == 'R')r++;
		if (s[i] == 'G')g++;
		if (s[i] == 'B')b++;
	}
	if (!r && !g)cout << "B";
	else if (!r && !b) cout << "G";
	else if (!b && !g) cout << "R";
	else if (r && g && b)cout << "BGR";
	else if (!r) {
		if (min(g, b) > 1)cout << "BGR";
		else if (g < b) {
		    cout << "GR";
		}
		else if (g == b) {
			if (g == 1)cout << "R";
			else cout << "BGR";
		}
		else cout << "BR";
	}
	else if (!g) {
		if (min(r, b) > 1)cout << "BGR";
		else if (r < b)cout << "GR";
		else if (r == b) {
			if (r == 1)cout << "G";
			else cout << "BGR";
		}
		else cout << "BG";
	}
	else if (!b) {
		if (min(g, r) > 1)cout << "BGR";
		else if (r < g)cout << "BR";
		else if (r == g) {
			if (r == 1)cout << "B";
			else cout << "BGR";
		}
		else cout << "BG";
	}
	return 0;
}

#include<bits/stdc++.h>
#define mx 100000
#define pb push_back
#define siz(v) v.size()
typedef unsigned long long ull;
typedef long long  ll;
using namespace std;

int main()
{
 	ios_base::sync_with_stdio(0);
 	cin.tie(0); cin.tie(0);
	// freopen("input.txt","r",stdin);
	string str;
	int n;
	cin >> n >> str;
	int r,g,b;
	r=g=b=0;
	for(int i=0;i<n;++i) {
		if (str[i]=='R') ++r;
		else if (str[i]=='G') ++g;
		else ++b;

	}

	if ((r==0 and g==0) or (g==0 and b==0) or (b==0 and r==0)){
		if (r) cout <<"R\n";
		else if (b) cout << "B\n";
		else cout <<"G\n";
	}
	else if (r and g and b)
		cout << "BGR\n";
	else {
		if (!r){
		  if (g==1 and b==1)	cout <<"R\n";
			else if (g==1)	    cout << "GR\n";
			else if (b==1)      cout << "BR\n";
			else                cout <<"BGR\n";
		}

		else if (!g){
			if (r==1 and b==1)	cout <<"G\n";
			else if (r==1)	    cout << "GR\n";
			else if (b==1)      cout << "BG\n";
			else                cout <<"BGR\n";
		}

		else {
			if (g==1 and r==1)	cout <<"B\n";
			else if (g==1)	    cout << "BG\n";
			else if (r==1)      cout << "BR\n";
			else                cout <<"BGR\n";
		}
	}

 return 0;
 }

#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <vector>

using namespace std;
typedef long long ll;

int dp[201][201][201];
bool ar = false, ag = false, ab = false;

void calc(int r, int g, int b){
    if(r < 0 || g < 0 || b < 0)return;
    if(r+g+b == 1){
        if(r == 1) ar = true;
        else if(g == 1) ag = true;
        else if(b == 1) ab = true;
    }else if(dp[r][g][b] != -1) return;
    else{
        dp[r][g][b] = true;

        if(r >= 2)calc(r-1,g,b);
        if(g >= 2)calc(r,g-1, b);
        if(b >= 2)calc(r,g,b-1);

        calc(r-1,g-1,b+1);
        calc(r-1,g+1,b-1);
        calc(r+1,g-1,b-1);
    }
}

int32_t main(){
    ios_base::sync_with_stdio(false);cin.tie(nullptr); cout.tie(nullptr);
    memset(dp,-1,sizeof dp);
    cin >> *(new int);
    string in; cin >> in;
    int r = 0, g = 0, b = 0;
    for(char c: in){
        if(c == 'B')b++;
        else if(c =='G')g++;
        else if(c == 'R')r++;
    }
    calc(r,g,b);
    if(ab) cout << "B";
    if(ag) cout << "G";
    if(ar) cout << "R";
    cout << endl;
}

#include <iostream>
#include <vector>
#include <string>
#include <bits/stdc++.h>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <deque>
#include <tuple>
#include <unordered_set>

using namespace std;
using ld = long double;
using ll = long long;

unordered_map<char, int> ccount;
bool vis[201][201][201];
void visit(int r, int g, int b) {
	if (!(r >= 0 && g >= 0 && b >= 0)) return;
	if (vis[r][g][b]) return;
	vis[r][g][b] = true;
	if (r>1) visit(r-1, g, b);
	if (g>1) visit(r, g-1, b);
	if (b>1) visit(r, g, b-1);
	visit(r-1, g-1, b+1);
	visit(r-1, g+1, b-1);
	visit(r+1, g-1, b-1);
}

int main()
{
	int n;
	cin >> n;
	for (int i=0; i<n; i++) {
		char c;
		cin >> c;
		ccount[c]++;
	}
	visit(ccount['R'], ccount['G'], ccount['B']);
	if (vis[0][0][1]) cout << 'B';
	if (vis[0][1][0]) cout << 'G';
	if (vis[1][0][0]) cout << 'R';

	return 0;
}

	#include<iostream>
	#include<cmath>
	#include<iomanip>
	#include<cctype>
	#include<vector>
	#include<algorithm>
	#include<map>
	using namespace std;

	int main(){
int n;
cin>>n;
char ch;
	int r=0,g=0,b=0;
		for(int i=0;i<n;i++)
		{
			cin>>ch;
			if(ch=='R')r++;
			else 	if(ch=='G')g++;
			else b++;

		}
			if(r==0 && g==0 || g!=0 &&r!=0 ||b!=0&&(g>1||r>1) )
			cout<<"B";
			if(r==0 && b==0 || r!=0 &&b!=0 ||g!=0&&(r>1||b>1) )
			cout<<"G";
			if(g==0 && b==0 || g!=0 &&b!=0 ||r!=0&&(g>1||b>1) )
			cout<<"R";

		return 0;
}

#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define loop(a,b,c) for(int a=b;a<c;a++)
#define sz(v) v.size()
#define reset(a,b) memset(a,b,sizeof a)
#define lb lower_bound
#define ub upper_bound

using namespace std;
const double PI=2*acos(0);
typedef long long LL;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
string DP[215][215][215];

string dp(int r,int g,int b){
    if((r==1&&g==0&&b==0)||(r==0&&g==1&&b==0)||(r==0&&g==0&&b==1)){
        if(r==1)return "R";
        else if(g==1)return "G";
        else if(b==1) return "B";
    }
    if(DP[r][g][b]==""){
        int rr=0,gg=0,bb=0;
        if(r>=1){
            if(r>=2){
                string tmp=dp(r-1,g,b);
                int kk=tmp.length();
                loop(i,0,kk)
                    if(tmp[i]=='R')rr=1;
                    else if(tmp[i]=='G')gg=1;
                    else bb=1;
            }
            if(g>0){
                string tmp=dp(r-1,g-1,b+1);
                int kk=tmp.length();
                loop(i,0,kk)
                    if(tmp[i]=='R')rr=1;
                    else if(tmp[i]=='G')gg=1;
                    else bb=1;
            }
            if(b>0){
                string tmp=dp(r-1,g+1,b-1);
                int kk=tmp.length();
                loop(i,0,kk)
                    if(tmp[i]=='R')rr=1;
                    else if(tmp[i]=='G')gg=1;
                    else bb=1;
            }
        }
        if(g>=1){
            if(g>=2){
                string tmp=dp(r,g-1,b);
                int kk=tmp.length();
                loop(i,0,kk)
                    if(tmp[i]=='R')rr=1;
                    else if(tmp[i]=='G')gg=1;
                    else bb=1;
            }
            if(b>0){
                string tmp=dp(r+1,g-1,b-1);
                int kk=tmp.length();
                loop(i,0,kk)
                    if(tmp[i]=='R')rr=1;
                    else if(tmp[i]=='G')gg=1;
                    else bb=1;
            }
        }
        if(b>1){
            string tmp=dp(r,g,b-1);
            int kk=tmp.length();
            loop(i,0,kk)
                if(tmp[i]=='R')rr=1;
                else if(tmp[i]=='G')gg=1;
                else bb=1;
        }
        string ans;
        if(bb==1)ans.pb('B'); if(gg==1)ans.pb('G'); if(rr==1)ans.pb('R');
        DP[r][g][b]=ans;
    }
    return DP[r][g][b];
}

int main(){
    int n,r=0,g=0,b=0;string s;
    cin>>n;
    cin>>s;
    loop(i,0,n)
        if(s[i]=='R')r++;
        else if(s[i]=='G')g++;
        else if(s[i]=='B')b++;
    string ans=dp(r,g,b);
    cout<<ans<<"\n";
}

#include<stdio.h>
#include<iostream>
#include<string>
#include<cstring>
#include <iomanip>
#include<stack>
#include<set>
#include<vector>
#include<algorithm>
#include<set>
#include<bitset>
#include<map>
#include<queue>
#include<math.h>
#include <time.h>
using namespace std;
//set<int>::iterator it;
#define mdlo 1000000007
#define maxERR 0.00000002
//#define minVal -10000000000000
#define maxBits 40
#define pi 3.1415926535897932384626433832795
#define INF 999999999999
#define lim 10000007
typedef long long ll;
long long mInv[41];
long long fact[41];
long long factInv[41];
map<long,long>mymap;
typedef pair<ll,ll>skill;
typedef pair<ll,ll>depth;
typedef vector<long>adj;
vector<long>primes;
set<long>candidates;

long cnts[202][202];
set<string>dictionary;
set<string>::iterator it;
pair<set<string>::iterator,bool> ret;
string ai,phn;
long len;
bool doesMatch(long pos){
	for(long i=0;i<len;i++){
		if(ai[pos+i]!=phn[i])
			return false;
	}
	return true;
}
long long getmoduloInv(long long n){
    if(n==1)
        return 1;
    if(mInv[n]>0)
        return mInv[n];
    long long m=(-1*mdlo)/n;
    m+=mdlo;
    m*=getmoduloInv(mdlo%n);
    mInv[n]=(m%mdlo);
    return mInv[n];
}
long num[200006],startTingPos[200005];
//ll times[1001006];

vector< long> get_primes(unsigned long max){

    char *sieve;
    sieve = new char[max/8+1];
    // Fill sieve with 1
    long m=(max/8)+1;
    for(long long i=0;i<m;i++)
        sieve[i]=255;
    for(unsigned long x = 2; x <= max; x++)
        if(sieve[x/8] & (0x01 << (x % 8))){
            primes.push_back(x);
            // Is prime. Mark multiplicates.
            for(unsigned long j = 2*x; j <= max; j += x)
                sieve[j/8] &= ~(0x01 << (j % 8));
        }
    delete[] sieve;
    return primes;
}

int main(void){
//  freopen ("E:/inputSmall.txt","r",stdin);
//  freopen ("E:/outputSmall2.txt","w",stdout);
    ll test_cases=1;//,C,D,A,L,R,rep,round=0,rem,num;
   //cin>>test_cases>>r>>v;
    cout << setprecision(15) << fixed;
//	get_primes(32000);
	memset(cnts,0,sizeof(cnts));
	long n,y=200,x=200,ans=0,r=0,g=0,b=0;
	cnts[x][y]=1;
    cin>>n;
	char ch;
	for(long i=0;i<n;i++){
		cin>>ch;
		if(ch=='R')
			r++;
		else if(ch=='G')
			g++;
		else
			b++;
	}
	if((r>0&&g>0)||(r==0&&g==0)||(b>0&&r+g>1))
		cout<<'B';
	if((r>0&&b>0)||(r==0&&b==0)||(g>0&&r+b>1))
		cout<<'G';
	if((b>0&&g>0)||(b==0&&g==0)||(r>0&&b+g>1))
		cout<<'R';
	//cout<<ans<<endl;
    return 0;
}
/*ll cumDist1[100005];
ll cumDist2[100005];
vector<ll>distFrom1;
vector<ll>distFrom2;
void initFact(){
    fact[0]=1;
    factInv[0]=1;
    for(ll i=1;i<0;i++){
        factInv[i]=(factInv[i-1]*getmoduloInv(i))%mdlo;
        fact[i]=(fact[i-1]*i)%mdlo;
    }
}
bool isLeapyear(long year){
    if(year%4==0&&(year%100!=0||year%400==0))
        return true;
    return false;
}
ll ds,ms,ys,de,me,ye,dc,mc,yc,day;
void next13th(){
    if(ds<13){
        ds=13;
        return;
    }
    ms++;
    ds=13;
    if(ms>12)
    {
        ms=1;
        ys++;
    }
}
    long months[]={31,28,31,30,31,30,31,31,30,31,30,31};
    long dayBeforeMonth[12];
bool validDate(){
    if(ys>ye)
        return false;
    if(ys<ye)
        return true;
    if(ms>me)
        return false;
    if(ms<me)
        return true;
    if(ds>de)
        return false;
    return true;
}
long getDay(long d,long m,long y){
    long day=((y-1900)*365+(y-1900)/4-(y-1900)/100+(y-1600)/400+dayBeforeMonth[m-1]+d+2)%7;
    if(y%4==0&&m<3){
        if(y%400==0||y%100!=0)
            day=(day+6)%7;
    }
    return day;
}
bool iscurDayFriday(){
    if(getDay(ds,ms,ys)==0)
        return true;
    return false;
}
void dijkstra(long startPoint){
    long m;
    if(startPoint==1)
        m=0;
    else
        m=1;
    distMatrix[m][startPoint]=0;
    priority_queue<edge, vector<edge>,greater <edge>>pq;
    pq.push(edge(0,startPoint));
    while(!pq.empty()){
        edge top=pq.top();
        pq.pop();
        ll d= top.first,u=top.second;
        if(distMatrix[m][u]==d){
            for(long i=0;i<graph[u].size();i++){
                ll v=graph[u][i].second;
                ll ec=graph[u][i].first;
                if(distMatrix[m][v]>distMatrix[m][u]+ec){
                    distMatrix[m][v]=distMatrix[m][u]+ec;
                    pq.push(edge(distMatrix[m][v],v));
                }
            }
        }
    }
}
ll vals[1];
ll dp[1];
ll totalSum[1];
long long mInv[1];
long long fact[1];
long long factInv[1];

//long long pow10[18];
long long getmoduloInv(long long n){
    if(n==1)
        return 1;
    if(mInv[n]>0)
        return mInv[n];
    long long m=(-1*mdlo)/n;
    m+=mdlo;
    m*=getmoduloInv(mdlo%n);
    mInv[n]=(m%mdlo);
    return mInv[n];
}
long long onNthbit(long pos,long val){
    return val|pwr2[pos];
}
bool isNthbitOn(long long pos,long long val){
    return (val&pwr2[pos])>0;
}

seg segTree[5];
long N;
void buildSumSegmentTree(long long b,long long e,long long node){
    if(b==e)
    {
         segTree[node].first=vals[b];
         return;
    }
    long long mid=(b+e)/2;
    buildSumSegmentTree(b,mid,node*2);
    buildSumSegmentTree(mid+1,e,1+(node*2));
    segTree[node].first=segTree[2*node].first+segTree[1+(node*2)].first;
}
long long getSum(long long qStart,long long qEnd,long long sStart,long long sEnd,long long node,prop p){

    long k=sEnd-sStart,n;
    for(long i=0;i<p.size();i++){
        segTree[node].second.push_back(p[i]);
        n=p[i];
        segTree[node].first+=(((n+k)*(n+k+1)*(2*n+2*k+1)-(n*(n-1)*(2*n-1)))/6+((n+k)*(n+k+1)-n*(n-1)))/2;
        }
    if(qEnd<sStart||qStart>sEnd)
    {
        return 0;
    }
    if(sStart>=qStart&&sEnd<=qEnd)
    {
         return segTree[node].first;
    }
    long long sMid=(sStart+sEnd)/2;
    prop l;
    for(long i=0;segTree[node].second.size();i++)
        l.push_back(segTree[node].second[i]+sMid+1-sStart);
    return getSum(qStart,qEnd,sStart,sMid,2*node,segTree[node].second)+getSum(qStart,qEnd,sMid+1,sEnd,1+(2*node),l);
}
long long update(ll node, long long sStart,ll sEnd,long upStart,long upEnd){
    if(upEnd<sStart||upStart>sEnd)
        return 0;
    long k=sEnd-sStart,n=sStart+1-upStart;
    if(upStart<=sStart&&upEnd>=sEnd){
        segTree[node].second.push_back(n);
        segTree[node].first+=(((n+k)*(n+k+1)*(2*n+2*k+1))/6);
        segTree[node].first-=(((n*(n-1)*(2*n-1)))/6);
        segTree[node].first+=(((n+k)*(n+k+1)-n*(n-1)))/2;
        return 0;
    }
    ll sMid=(sStart+sEnd)/2;
    update(node*2,sStart,sMid,upStart,upEnd);
    update(1+(node*2),sMid+1,sEnd,upStart,upEnd);
    segTree[node].first=segTree[2*node].first+segTree[1+(node*2)].first;

    for(long i=0;i<segTree[node].second.size();i++){
        n=segTree[node].second[i];
        segTree[node].first+=(((n+k)*(n+k+1)*(2*n+2*k+1)-(n*(n-1)*(2*n-1)))/6+((n+k)*(n+k+1)-n*(n-1)))/2;
    }
    return segTree[node].first;
}
void update(long x,long y){
    long len=y-x+1,add=0;
    for(long i=0;i<len;i++){
        add+=(i+1)*2;
        update(1,0,N-1,x+i,add+vals[x+i]);
    }
}
long getlen(long long num){
    long len=0;
    while(num>0){
        num/=10;
        len++;
    }
    return len;
}
encryptedLine lineConverter(string s){
    encryptedLine el;
    ll val=0,len=s.size();
    for(long i=0;i<len;i++){
        if(s[i]==' '){
            el.push_back(val);
            val=0;
        }
        else{
            val*=26;
            val+=(s[i]-'a');
        }
    }
    el.push_back(val);
    return el;
}
long getPalinDrome(long num){
    long a=num%10;
    long b=(num/10)%10;
    long c=(num/100)%10;
    return num*1000+a*100+b*10+c;
}

vector<unsigned long> get_primes(unsigned long max){
    vector<unsigned long> primes;
    char *sieve;
    sieve = new char[max/8+1];
    // Fill sieve with 1
    long m=(max/8)+1;
    for(long long i=0;i<m;i++)
        sieve[i]=255;
    for(unsigned long x = 2; x <= max; x++)
        if(sieve[x/8] & (0x01 << (x % 8))){
            primes.push_back(x);
            // Is prime. Mark multiplicates.
            for(unsigned long j = 2*x; j <= max; j += x)
                sieve[j/8] &= ~(0x01 << (j % 8));
        }
    delete[] sieve;
    return primes;
}string add(string a,string b){
    int l1=a.size();
    int l2=b.size();
    while(l1<l2){
        a="0"+a;
        l1++;
    }
    while(l2<l1){
        b="0"+b;
        l2++;
    }
    string s;
    int carry=0;
    for(long i=l2-1;i>-1;i--){
        int d=a[i]+b[i]+carry-2*'0';
        carry=d/10;
        a[i]='0'+(d%10);
    }
    if(carry)
        a="1"+a;
    return a;
}
long long mInv[1010];
long long fact[1000];
long long factInv[1000];
long long getmoduloInv(long long n){
    if(n==1)
        return 1;
    if(mInv[n]>0)
        return mInv[n];
    long long m=(-1*mdlo)/n;
    m+=mdlo;
    m*=getmoduloInv(mdlo%n);
    mInv[n]=(m%mdlo);
    return mInv[n];

}

long dp[200010];
vector<weightedPos>points;
vector<weightedPos>modifiedPositions;
vector<long long>weightPlusPos;
long long segTree[530010];
long N,X,W;
void buildSegTree(long node,long b,long e){
    if(b==e)
        segTree[node]=b;
    else{
        long mid=(b+e)/2;
        buildSegTree(node*2,b,mid);
        buildSegTree(1+node*2,mid+1,e);
        if(weightPlusPos[segTree[node*2]]<=weightPlusPos[segTree[1+node*2]])
            segTree[node]=segTree[node*2];
        else
            segTree[node]=segTree[1+node*2];
    }
}
long long getMin(long node,long segBeg,long segEnd,long qBeg,long qEnd){
    if(segEnd<qBeg||segBeg>qEnd)
        return N;
    if(segBeg>=qBeg&&segEnd<=qEnd)
        return segTree[node];
    long mid=(segBeg+segEnd)/2;
    long fh=getMin(node*2,segBeg,mid,qBeg,qEnd);
    long sh=getMin(1+node*2,mid+1,segEnd,qBeg,qEnd);
    if(weightPlusPos[sh]<weightPlusPos[fh])
        return sh;
    return fh;
}
long long getMinPos(long node,long segBeg,long segEnd,long qBeg,long qEnd){
    if(segEnd<qBeg||segBeg<qEnd)
        return 0;
    if(segBeg>=qBeg&&segEnd<=qEnd)
        return segTree[node];
    long mid=(segBeg+segEnd)/2;
    long fh=getMin(node*2,segBeg,mid,qBeg,qEnd);
    long sh=getMin(node*2,mid+1,segEnd,qBeg,qEnd);
    return min(fh,sh);
}
long getPos(long val){
    long low=0,high=modifiedPositions.size()-1;
    long mid=(low+high)/2;
    while(low<high){
        if(modifiedPositions[mid].first<val)
            low=mid+1;
        else
            high=mid-1;
        mid=(low+high)/2;
    }
    if(mid>0)
        mid--;
    while(mid<modifiedPositions.size()&&modifiedPositions[mid].first<val)
        mid++;
    return mid;
}
long getMaxGroup(long index){
    if(dp[index]>-1)
        return dp[index];
    long pos=getPos(points[index].first+points[index].second);
    if(pos>=N)
        return 1;
    long nextPoint=getMin(1,0,N-1,pos,N-1);
    dp[index]=1+getMaxGroup(nextPoint);
    return dp[index];
}
*/

#include <bits/stdc++.h>
using namespace std;

set<char> ans;
int b,r,g;
int n;
string s;

bool dp[205][205][205];

void go(int bb,int rr, int gg ){

	if(dp[bb][rr][gg]++)
		return;

	if(bb+rr+gg==1){
		if(bb==1)
		ans.insert('B');
		else if(rr==1)
			ans.insert('R');
		else
			ans.insert('G');
		return;
	}
	if(bb == 0 && gg == 0)
	{
		ans.insert('R');
		return;
	}
	if(gg==0 && rr==0){
		ans.insert('B');
		return;
	}
	if(rr==0&&bb==0){
		ans.insert('G');
		return;
	}
	if(bb>=2){

		go(bb-1,rr,gg);

	}
	if(gg>=2){
	go(bb,rr,gg-1);	}
	if(rr>=2){
		go(bb,rr-1,gg);
	}
	if(bb>0 && rr>0){
		go(bb-1,rr-1,gg+1);
	}
	if(bb>0 && gg>0){
				go(bb-1,rr+1,gg-1);

	}
	if(rr>0 && gg>0){
				go(bb+1,rr-1,gg-1);

	}

}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin>>n;
	cin>>s;
	for(int i=0;i<n;i++){
		if(s[i]=='B')
			b++;
		else if(s[i]=='G')
			g++;
		else
			r++;
	}
	//cout<<r<<g<<b;

	go(b,r,g);

	for(auto x:ans)
		cout<<x;

	return 0;

}

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mod 1e9
#define ll long long
#define F first
#define S second
#define pii pair<int,int>
#define FOR(i,k,n) for(int i=k;i<n+k;i++)
#define ALL(x) x.begin(),x.end()

int main(){
	int n;cin>>n;string s;cin>>s;
	int r,b,g;
	r=b=g=0;
	for(auto it:s){
		if(it=='R') r++;
		else if(it=='B') b++;
		else g++;
	}
	if(r>0&&b>0&&g>0){
		cout<<"BGR"<<endl;
		return 0;
	}else if(r>0&&g>0){
		if(r==1&&g==1) cout<<"B"<<endl;
		else if(r==1&&g>1) cout<<"BR"<<endl;
		else if(g==1&&r>1) cout<<"BG"<<endl;
		else cout<<"BGR"<<endl;
	}else if(r>0&&b>0){
		if(r==1&&b==1) cout<<"G"<<endl;
		else if(r==1&&b>1) cout<<"GR"<<endl;
		else if(b==1&&r>1) cout<<"BG"<<endl;
		else cout<<"BGR"<<endl;
	}else if(b>0&&g>0){
		if(b==1&&g==1) cout<<"R"<<endl;
		else if(b==1&&g>1) cout<<"BR"<<endl;
		else if(g==1&&b>1) cout<<"GR"<<endl;
		else cout<<"BGR"<<endl;
	}else if(r>0){
		cout<<"R"<<endl;
	}else if(g>0){
		cout<<'G'<<endl;
	}else cout<<"B"<<endl;
}

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <list>
#include <string>
#include <string.h>

using namespace std;

void solve(int n) {
    string str;
    cin >> str;
    int red = 0 ,blue = 0,green = 0;
    for ( int  i =0; i <n; ++i)  {
        if (str[i] == 'R') {
            red++;
        }
        if (str[i] == 'G') {
            green++;
        }
        if (str[i] == 'B') {
            blue++;
        }
    }
    if( red != 0 && blue != 0 && green != 0) {
        cout << "BGR" <<endl;
        return;
    }
    if ( red > 1 && blue > 1) {
        cout << "BGR" << endl;
        return;
    }
    if ( red > 1 && green > 1) {
        cout << "BGR" << endl;
        return;
    }
    if ( green > 1 && blue > 1) {
        cout << "BGR" << endl;
        return;
    }
    if ( red == 1 && blue > 1 ) {
        cout << "GR" <<endl;
        return;
    }
    if ( red == 1 && green > 1 ) {
        cout << "BR" <<endl;
        return;
    }
    if ( green == 1 && blue > 1 ) {
        cout << "GR" <<endl;
        return;
    }
    if ( green == 1 && red > 1 ) {
        cout << "BG" <<endl;
        return;
    }
    if ( blue == 1 && red > 1 ) {
        cout << "BG" <<endl;
        return;
    }
    if ( blue == 1 && green > 1 ) {
        cout << "BR" <<endl;
        return;
    }
    if ( red == 1 && blue == 1 ) {
        cout << "G" <<endl;
        return;
    }
    if ( green == 1 && blue == 1 ) {
        cout << "R" <<endl;
        return;
    }
    if ( red == 1 && green == 1 ) {
        cout << "B" <<endl;
        return;
    }
    if ( red != 0 ) {
        cout << "R" <<endl;
        return;
    }
    if ( blue != 0 ) {
        cout << "B" <<endl;
        return;
    }
    if ( green != 0 ) {
        cout << "G" <<endl;
        return;
    }

    return;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif
    int n;
    while(scanf("%d",&n)!=EOF){
        solve(n);
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define mk make_pair

bool mem[205][205][205];
string ans = "";
void dp(ll a,ll b, ll c, ll t)
{
    if(mem[a][b][c])
    {
        return ;
    }

    if(t==1)
    {
        if(a)
        {
            ans+='R';
        }
        if(b)
        {
            ans+='B';
        }
        if(c)
        {
            ans+='G';
        }
    }

    mem[a][b][c] = true;

    if(a>1)
    {
        dp(a-1, b,c,t-1);
    }
    if(b>1)
    {
        dp(a, b-1,c,t-1);
    }
    if(c>1)
    {
        dp(a,b,c-1,t-1);
    }

    if(a&&b)
    {
        dp(a-1,b-1,c+1,t-1);
    }
    if(a&&c)
    {
        dp(a-1,b+1,c-1,t-1);
    }
    if(c&&b)
    {
        dp(a+1,b-1,c-1,t-1);
    }
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll n;
    cin>>n;
    string x;
    cin>>x;
    ll a,b,c;
    memset(mem, 0, sizeof(mem));
    a = count(x.begin(), x.end(), 'R');
    b = count(x.begin(), x.end(), 'B');
    c = count(x.begin(), x.end(), 'G');
    dp(a,b,c,n);
    sort(ans.begin(), ans.end());
    cout<<ans<<endl;

    return 0;
}

#include <iostream>
#include <string>

using namespace std;

int main()
{
	int card_number = 0;
	string color = "";
	//bool color_R = false;
	//bool color_G = false;
	//bool color_B = false;
	int number_R = 0, number_G = 0, number_B = 0, color_number = 0;

	cin >> card_number;
	cin >> color;

	for  (int i = 0; i < card_number; i++)
	{
			if (color[i] == 'R') {
		//		color_R = true;
				number_R++;
			}
			else if (color[i] == 'G') {
		//		color_G = true;
				number_G++;
			}
			else if (color[i] == 'B') {
		//		color_B = true;
				number_B++;
			}
	}

	if (number_B)
		color_number++;
	if (number_G)
		color_number++;
	if (number_R)
		color_number++;

	if (color_number == 3) {
		cout << "BGR" << endl;
	}

	else if (color_number == 2)
	{
		if (number_B == 0) {
			if (number_R == 1 && number_G == 1) {
				cout << "B" << endl;
			}
			else if (number_R > 1 && number_G == 1) {
				cout << "BG" << endl;
			}
			else if (number_R == 1 && number_G > 1)
			{
				cout << "BR" << endl;
			}
			else if (number_R >= 2 && number_G >= 2)
				cout << "BGR" << endl;
		}

		if (number_G == 0) {
			if (number_R == 1 && number_B == 1) {
				cout << "G" << endl;
			}
			else if (number_R > 1 && number_B == 1) {
				cout << "BG" << endl;
			}
			else if (number_R == 1 && number_B > 1)
			{
				cout << "GR" << endl;
			}
			else if (number_R >= 2 && number_B >= 2) {
				cout << "BGR" << endl;
			}
		}

		if (number_R == 0 ) {
			if (number_B == 1  && number_G == 1) {
				cout << "R" << endl;
			}
			else if (number_B > 1 && number_G == 1) {
				cout << "GR" << endl;
			}
			else if (number_B == 1 && number_G > 1)
			{
				cout << "BR" << endl;
			}
			else if (number_B >= 2 && number_G >= 2) {
				cout << "BGR" << endl;
			}
		}

	}
	else if (color_number == 1) {
		if (number_B)
			cout << "B" << endl;
		if (number_G)
			cout << "G" << endl;
		if (number_R)
			cout << "R" << endl;
	}

//	cin >> color;
    return 0;
}

//author - techaddict
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
#define FOR(i, n) for ((i) = 0; (i) < (int)(n); (i)++)
#define ALL(v) ((v).begin()), ((v).end())
int memo[210][210][210];
int solve(int r, int g, int b) {
  if (memo[r][g][b] != 0) return memo[r][g][b];
  // if (r == 0 && g == 0 && b == 0) return 0;
  if (r == 0 && g == 0) return 4;
  if (r == 0 && b == 0) return 2;
  if (g == 0 && b == 0) return 1;
  if (r + g + b == 1) {
    if (b == 1) return 4;
    if (g == 1) return 2;
    if (r == 1) return 1;
  }
  int& res = memo[r][g][b];
  if (r > 0 && g > 0) res |= solve(r - 1, g - 1, b + 1);
  if (g > 0 && b > 0) res |= solve(r + 1, g - 1, b - 1);
  if (r > 0 && b > 0) res |= solve(r - 1, g + 1, b - 1);
  if (r >= 2) res |= solve(r - 1, g, b);
  if (g >= 2) res |= solve(r, g - 1, b);
  if (b >= 2) res |= solve(r, g, b - 1);
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
#ifndef ONLINE_JUDGE
  freopen("input", "r", stdin);
#endif

  int n, i;
  cin >> n;
  string s;
  cin >> s;
  int r = count(ALL(s), 'R'), g = count(ALL(s), 'G'), b = count(ALL(s), 'B');
  int res = solve(r, g, b);
  string str = "";
  if (res & 1) str += 'R';
  if (res & 2) str += 'G';
  if (res & 4) str += 'B';
  sort(ALL(str));
  cout << str << endl;
  return 0;
}

#include <bits/stdc++.h>

using namespace std;

int n;
int bs,gs,rs;
bool okb, okg, okr;
bool visit[201][201][201];

void solve(int i, int j, int k){
	if(i == 1 && j == 0 && k == 0){
		okb = true;
		return;
	}
	if(i == 0 && j == 1 && k == 0){
		okg = true;
		return;
	}
	if(i == 0 && j == 0 && k == 1){
		okr = true;
		return;
	}

	if(visit[i][j][k])return;

	visit[i][j][k]=1;

	if(i > 0 && j > 0){
		solve(i-1,j-1,k+1);
	}
	if(i > 1){
		solve(i-1,j,k);
	}

	if(i > 0 && k > 0){
		solve(i-1,j+1,k-1);
	}
	if(k > 1){
		solve(i,j,k-1);
	}

	if(k > 0 && j > 0){
		solve(i+1,j-1,k-1);
	}
	if(j > 1){
		solve(i,j-1,k);
	}
}

int main () {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin >> n;

	for(int i = 0; i < n; i++){
		char c;
		cin >> c;
		if(c == 'R') rs++;
		if(c == 'B') bs++;
		if(c == 'G') gs++;
	}
	solve(bs,gs,rs);

	if(okb) cout << "B";
	if(okg) cout << "G";
	if(okr) cout << "R";
	cout << "\n";
	return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define pii pair < int, int >
#define pll pair < ll, ll >
#define pci pair < char, int >
#define pb push_back
#define maxn 1005
#define inf 1e9
#define pi acos(-1)
#define fast ios_base::sync_with_stdio(false)
#define fffc cin.tie(NULL)
using namespace std;

int main()
{
    fast;
    fffc;

    int n;
    string s;

    cin >> n >> s;

    if(n == 1){
        cout << s << endl;
        return 0;
    }

    if(n == 2){
        sort(s.begin(), s.end());

        if(s[0] == s[1]) cout << s[0] << endl;
        else if(s == "BG") cout << 'R' << endl;
        else if(s == "BR") cout << 'G' << endl;
        else cout << 'B' << endl;

        return 0;
    }

    int b = 0, r = 0, g = 0;
    bool fb = 0, fr = 0, gr = 0;

    for(int i = 0; i < n; i++){
        if(s[i] == 'R') r++;
        else if(s[i] == 'B') b++;
        else g++;
    }

    if(r && b && g) cout << "BGR" << endl;
    else if(b == 1){
        if(g == 0) cout << "BG" << endl;
        else cout << "BR" << endl;
    }
    else if(g == 1){
        if(r == 0) cout << "GR" << endl;
        else cout << "BG" << endl;
    }
    else if(r == 1){
        if(b == 0) cout << "BR" << endl;
        else cout << "GR" << endl;
    }
    else if(b == n) cout << 'B' << endl;
    else if(g == n) cout << 'G' << endl;
    else if(r == n) cout << 'R' << endl;
    else cout << "BGR" << endl;

    return 0;
}

//In the name of Allah :)
#include <bits/stdc++.h>
using namespace std;

const int MAXN = 210, MOD = 1e9 + 7;

char in;
int cnt[3];
bool mark[MAXN][MAXN][MAXN];
vector <char> dp[MAXN][MAXN][MAXN];

inline int id(char x){
	if(x == 'B') return 0;
	if(x == 'G') return 1;
	return 2;
}

vector <char> dfs(const int& b, const int& g, const int& r){
	if(mark[b][g][r]){
		return dp[b][g][r];
	}
	if(r + b + g == 1){
		if(r == 1) return {'R'};
		if(b == 1) return {'B'};
		if(g == 1) return {'G'};
	}
	set <char> ans;
	if(b > 1) for(auto i : dfs(b - 1, g, r)) ans.insert(i);
	if(r > 1) for(auto i : dfs(b, g, r - 1)) ans.insert(i);
	if(g > 1) for(auto i : dfs(b, g - 1, r)) ans.insert(i);
	if(b && r) for(auto i : dfs(b - 1, g + 1, r - 1)) ans.insert(i);
	if(g && r) for(auto i : dfs(b + 1, g - 1, r - 1)) ans.insert(i);
	if(b && g) for(auto i : dfs(b - 1, g - 1, r + 1)) ans.insert(i);
	mark[b][g][r] = 1;
	vector <char> m;
	for(auto i : ans) m.push_back(i);
	return dp[b][g][r] = m;
}

int main()
{
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> in;
		cnt[id(in)]++;
	}

	auto tmp = dfs(cnt[0], cnt[1], cnt[2]);

	for(auto i : tmp){
		cout << i;
	}
	cout << '\n';
}

#include <algorithm>
#include <iostream>
#include <string>
#include <stdio.h>
#include <vector>
#include <stack>
#include <map>
#include <iomanip>
#include <cfloat>
#include <limits.h>
#include <math.h>

using namespace std;

int main()
{
	int n;
	cin >> n;

	string s;
	cin >> s;

	int rCount = 0;
	int gCount = 0;
	int bCount = 0;

	for (int i = 0; i < n; i++)
	{
		if (s[i] == 'R') rCount++;
		if (s[i] == 'G') gCount++;
		if (s[i] == 'B') bCount++;
	}

	if (rCount>0 && gCount > 0 && bCount > 0)
	{
		cout << "BGR";
	}
	else
	{
		if (rCount + gCount == 0)
		{
			cout << "B";
			return 0;
		}

		if (gCount + bCount == 0)
		{
			cout << "R";
			return 0;
		}

		if (rCount + bCount == 0)
		{
			cout << "G";
			return 0;
		}

		if (rCount == 1)
		{
			if (gCount > 0)
			{
				if (gCount == 1)
				{
					cout << "B";
				}
				else
				{
					cout << "BR";
				}
			}
			else
			{
				if (bCount == 1)
				{
					cout << "G";
				}
				else
				{
					cout << "GR";
				}
			}

			return 0;
		}

		if (gCount == 1)
		{
			if (rCount > 0)
			{
				if (rCount == 1)
				{
					cout << "B";
				}
				else
				{
					cout << "BG";
				}
			}
			else
			{
				if (bCount == 1)
				{
					cout << "R";
				}
				else
				{
					cout << "GR";
				}
			}

			return 0;
		}

		if (bCount == 1)
		{
			if (rCount > 0)
			{
				if (rCount == 1)
				{
					cout << "G";
				}
				else
				{
					cout << "BG";
				}
			}
			else
			{
				if (gCount == 1)
				{
					cout << "R";
				}
				else
				{
					cout << "BR";
				}
			}

			return 0;
		}

		cout << "BGR";
	}

	return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<math.h>
#include<string.h>
#include<iostream>
#include<queue>
#include<ctype.h>
using namespace std;
#define N 1005
#define met(a,b) memset(a,b,sizeof(b))

char str[205];

int main()
{
    int n;
    while(scanf("%d",&n)!=EOF)
    {
        met(str,0);
        int r,b,g;
        r=g=b=0;
        scanf("%s",str);
        for(int i=0;i<n;i++)
        {
            if(str[i]=='R')
                r++;
            if(str[i]=='B')
                b++;
            if(str[i]=='G')
                g++;
        }
        if(r&&b&&g)
            printf("BGR\n");
        else
        {
            if(r==0)
            {
                if(g>=2 && b>=2)
                    printf("BGR\n");
                else if(g==0)
                    printf("B\n");
                else if(b==0)
                    printf("G\n");
                else if(g==1 && b==1)
                    printf("R\n");
                else if(g==1 && b>=2)
                    printf("GR\n");
                else if(g>=2 && b==1)
                    printf("BR\n");
            }
            else if(g==0)
            {
                if(b==0)
                    printf("R\n");
                else if(b>=2 && r>=2)
                    printf("BGR\n");
                else if(b==1 && r==1)
                printf("G\n");
                else if(b==1 && r>=2)
                    printf("BG\n");
                else if(b>=2 && r==1)
                    printf("GR\n");
            }
            else if(b==0)
            {
                if(g>=2 && r>=2)
                    printf("BGR\n");
                else if(g==1 && r==1)
                    printf("B\n");
                else if(g==1 && r>=2)
                    printf("BG\n");
                else if(g>=2 && r==1)
                    printf("BR\n");
            }
        }
    }
    return 0;
}

//RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR

/**
 *   author:   vasugondaliya
 *   created:  13.07.2020 23:19:00
**/
#include <bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false), cin.tie(NULL);
    int n;
    string s;
    cin >> n >> s;
    map<char, int> m = {{'R', 0}, {'G', 1}, {'B', 2}};
    int a[3] = {};
    for (auto c : s)
    {
        a[m[c]]++;
    }
    int r = a[0], g = a[1], b = a[2];
    if (r > 0 && g > 0 && b > 0)
    {
        cout << "BGR";
    }
    else if (b == 0 && g == 0)
    {
        cout << "R";
    }
    else if (r == 0 && b == 0)
    {
        cout << "G";
    }
    else if (r == 0 && g == 0)
    {
        cout << "B";
    }
    else if (n == 2 && r == 0)
    {
        cout << "R";
    }
    else if (n == 2 && g == 0)
    {
        cout << "G";
    }
    else if (n == 2 && b == 0)
    {
        cout << "B";
    }
    else
    {
        if (r == 0)
        {
            if (b == 1)
            {
                cout << "BR";
            }
            else if (g == 1)
            {
                cout << "GR";
            }
            else
            {
                cout << "BGR";
            }
        }
        else if (g == 0)
        {
            if (r == 1)
            {
                cout << "GR";
            }
            else if (b == 1)
            {
                cout << "BG";
            }
            else
            {
                cout << "BGR";
            }
        }
        else if (b == 0)
        {
            if (g == 1)
            {
                cout << "BG";
            }
            else if (r == 1)
            {
                cout << "BR";
            }
            else
            {
                cout << "BGR";
            }
        }
    }
    return 0;
}

#include <iostream>
using namespace std;
int main()
{
    string x;
    long long r=0, b=0,g=0,i,n;
    cin >> n;
    cin >> x;
    for (i = 0; i < n; i++)
    {
        if (x[i] == 'R')
            r++;
        else if (x[i] == 'G')
            g++;
        else
            b++;
    }//cout<<b<<" "<<g<<" "<<r;
  if (b==0)
  {
      if (g==0)
      {
          cout<<"R";
      }
      else if (r==0)
      {
          cout<<"G";
      }
      else if (r==1 && g==1)
      {
          cout<<"B";
      }else if (r==1 && g>1)
      {
          cout<<"BR";
      }
      else if (r>1 && g==1)
      {
          cout<<"BG";
      }
      else
      {
          cout<<"BGR";
      }
  }else if(b==1)
  {
      if (g==0)
      {
         if (r==0)
         {cout<<"B";}
         else if (r==1)
         {
             cout<<"G";
         }
         else
         {
             cout<<"BG";
         }
      }
      else if (r==0)
      {
          if (g==1)
         {
             cout<<"R";
         }
         else
         {
             cout<<"BR";
         }
      }
      else
      {
          cout<<"BGR";
      }
  }

  else
  {
     if (g==0)
      {
         if (r==0)
         {cout<<"B";}
         else if (r==1)
         {
             cout<<"GR";
         }
         else
         {
             cout<<"BGR";
         }
      }
      else if (r==0)
      {
          if (g==1)
         {
             cout<<"GR";
         }
         else
         {
             cout<<"BGR";
         }
      }
      else
      {
          cout<<"BGR";
      }
  }
}

#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define eb emplace_back
#define vi vector<int>
#define vll vector<ll>
#define REP(i,a,b) for(ll i=a; i<b;i++)
#define fill(arr, i) memset(arr, i, arr.size()*sizeof(arr[0]))
#define coutv(arr) cout<<#arr<<": " ; for(auto i: arr) cout<<(i==INT_MAX?'I':i)<<" "; cout<<"\n";
#define cout(n) cout<<fixed<<setprecision(n)
#define name(x) cout<<#x<<": "<<x<<"\n";
#define ms(a,x) memset(a, x, sizeof(a))
#define gcd(a,b) __gcd(a,b)
// freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);

int n;
string str;
string rgb = "RGB";
string ans;

int main(){
	cin>>n>>str;
	map<char, int> cnt;
	for(char ch: str){
		cnt[ch]++;
	}
	if(cnt.size() == 3){
		ans = rgb;
	}
	else if(cnt.size()==2){
		bool one = (cnt['R']==1 || cnt['G']==1 || cnt['B']==1);
		bool bothone = ((cnt['R']==1 )^( cnt['G']==1) ^ (cnt['B']==1)) == 0;
		if(one){
			for(char ch: rgb){
				if(cnt[ch] == 0){
					ans+=ch;
				}
				else if(cnt[ch] == 1 && !bothone){
					ans+=ch;
				}
			}

		}
		else{
			ans= rgb;
		}
	}
	else {
		ans+=str[0];
	}
	sort(ans.begin(), ans.end());
	cout<<ans;
}

#include <iostream>
#include <string>
#include <algorithm>
#include <bits/stdc++.h>
#include <stdio.h>
#include <stdlib.h>
const double PI = acos(-1.0);
using namespace std ;
const int Max = 10055;
int gcd( long long a , long long b )
{
    if ( b == 0 )
    return a ;
    else
        return  gcd ( b , a % b ) ;
}
 long long lcm ( long long  a , long long b )
{
    return ( a* ( b / gcd ( a , b ) ) ) ;
}
bool com ( string x , string y )
{
    return x + y < y + x ;
}
//bool prime[1000005] ;
//void testprime( )
//{
//
//    for (int p = 1 ; p <= 1000000 ; p++ )
//        prime[p] = true ;
//    for (int p = 2 ; p * p <= 1000000 ; p++ )
//    {
//        if ( prime[p] == true)
//        {
//            for (int i = p * 2 ; i <= 1000000 ; i += p )
//                prime[i] = false ;
//        }
//    }
////    for ( int p = 2 ; p <= 1000000 ; p++ )
////       if ( prime[p] )
////          cout << p << " ";
//}
int memo[202][202][202] , R , G , B , rbg[3];
int dp ( int g , int b , int r )
{
    int x = memo[g][b][r] ; /// 0 R , 1 G , 2 B :P
    if ( x != -1)
        return 0 ;
    else
        memo[g][b][r] = 1 ;
    if ( r + g + b == 1)
    {
        if ( r ) rbg[0]++;
        if ( g ) rbg[1]++;
        if ( b ) rbg[2]++;
    }
    if ( g > 0 && r > 0 )
        dp ( g - 1 , b + 1 , r - 1 ) ;
    if ( g > 0 && b > 0 )
        dp ( g - 1 , b - 1 , r + 1 ) ;
    if ( b > 0 && r > 0 )
        dp ( g + 1 , b - 1 , r - 1 ) ;
    if ( r > 1 )
        dp ( g , b , r - 1 ) ;
    if ( g > 1 )
        dp ( g - 1 , b , r ) ;
    if ( b > 1 )
        dp ( g , b - 1 , r ) ;
}
int main()
{
     memset ( memo , -1 , sizeof ( memo) ) ;
     int n ;
     cin >> n ;
     string s ;
     cin >> s ;
     for ( int i = 0 ; i < s.length() ; i++ )
     {
         if ( s[i] == 'G' )
            G++ ;
         else if ( s[i] == 'R' )
            R++ ;
         else
            B++ ;
     }
     dp ( G , B , R ) ;
     if ( rbg[2] )
        cout << "B" ;
    if ( rbg[1] )
        cout << "G" ;
     if ( rbg[0] )
        cout << "R" ;
     return 0 ;
    /*
───────────▄▄▄▄▄▄▄▄▄▄▄▄▄
────────▄▀▀─────────────▀▀▄
───────█───────────────────█
──────█─────────────────────█
─────█───▄▄▄▄▄▄▄───▄▄▄▄▄▄▄───█
────█───█████████─█████████───█
────█──██▀────▀█████▀────▀██──█
───██████───█▀█─███───█▀█─██████
───██████───▀▀▀─███───▀▀▀─██████
────█──▀█▄────▄██─██▄────▄█▀──█
────█────▀█████▀───▀█████▀────█
────█───────────────▄▄▄───────█
────█───────▄▄▄▄██▀▀█▀▀█▄─────█
────█─────▄██▄█▄▄█▄▄█▄▄██▄────█
────█─────▀▀█████████████▀────█
───▐▓▓▌─────────────────────▐▓▓▌
───▐▐▓▓▌▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▐▓▓▌▌
───█══▐▓▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄▓▌══█
──█══▌═▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌═▐══█
──█══█═▐▓▓▓▓▓▓▄▄▄▄▄▄▄▓▓▓▓▓▓▌═█══█
──█══█═▐▓▓▓▓▓▓▐██▀██▌▓▓▓▓▓▓▌═█══█
──█══█═▐▓▓▓▓▓▓▓▀▀▀▀▀▓▓▓▓▓▓▓▌═█══█

──█───█─█──█─█▀▀█─▀▀█▀▀─▀█─█─▀█──
──█▄█▄█─█▀▀█─█▄▄█───█───█▀─▀─█▀──
───▀─▀──▀──▀─▀──▀───▀───▄──▄─▄───
       Brace yourself Mesoo is coming ^_^

*/
}

#include <bits/stdc++.h>
#define ll long long
#define MOD (ll)1e9+7
using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	int r = 0, g = 0, b = 0;
	for(int i = 0; i < n; i ++)
	{
		char c;
		cin >> c;
		if(c == 'R')
		{
			r ++;
		}
		else if(c == 'G')
		{
			g ++;
		}
		else
		{
			b ++;
		}
	}
	if(n == r)
	{
		cout << "R";
		return 0;
	}
	else if(n == g)
	{
		cout << "G";
		return 0;
	}
	else if(n == b)
	{
		cout << "B";
		return 0;
	}
	if(r == 0)
	{
		if(b > 1 && g > 1)
		{
			cout << "BGR";
			return 0;
		}
		if(b == 1 && g == 1)
		{
			cout << "R";
			return 0;
		}
		if(g == 0)
		{
			cout << "B";
			return 0;
		}
		if(g == 1 && b > 0)
		{
			cout << "GR";
			return 0;
		}
		if(b == 0)
		{
			cout << "G";
			return 0;
		}
		if(b == 1 && g > 0)
		{
			cout << "BR";
			return 0;
		}
	}
	else if(g == 0)
	{
		if(b > 1 && r > 1)
		{
			cout << "BGR";
			return 0;
		}
		if(b == 1 && r == 1)
		{
			cout << "G";
			return 0;
		}
		if(r == 0)
		{
			cout << "B";
			return 0;
		}
		if(r == 1 && b > 0)
		{
			cout << "GR";
			return 0;
		}
		if(b == 0)
		{
			cout << "G";
			return 0;
		}
		if(b == 1 && r > 0)
		{
			cout << "BG";
			return 0;
		}
	}
	else if(b == 0)
	{
		if(g > 1 && r > 1)
		{
			cout << "BGR";
			return 0;
		}
		if(g == 1 && r == 1)
		{
			cout << "B";
			return 0;
		}
		if(r == 0)
		{
			cout << "G";
			return 0;
		}
		if(r == 1 && g > 0)
		{
			cout << "BR";
			return 0;
		}
		if(g == 0)
		{
			cout << "R";
			return 0;
		}
		if(g == 1 && r > 0)
		{
			cout << "BG";
			return 0;
		}
	}
	cout << "BGR";
	return 0;
}

#include<cstdio>
#include<cstring>
using namespace std;
char ch[210];
int main()
{
	int n;
	scanf("%d%s", &n, ch);
	int b, g, r;
	b = g = r = 0;
	for(int i = 0; i < n; ++i)
	{
		if(ch[i]=='B') ++b;
		else if(ch[i] == 'R') ++r;
		else  ++g;
	}
	if(b && g && r)
	{
        printf("BGR");
        return 0;
    }
    if(!b && !g)
	{
        printf("R");
        return 0;
    }
    if(!b && !r)
	{
        printf("G");
        return 0;
    }
    if(!g && !r)
	{
        printf("B");
        return 0;
    }
    if(!b)
	{
        if(g > 1 && r > 1)
		{
            printf("BGR");
            return 0;
        }
        if(g == 1 && r == 1)
		{
            printf("B");
            return 0;
        }
        if(g == 1)
		{
            printf("BG");
            return 0;
        }
        else
		{
            printf("BR");
            return 0;
        }
    }
    if(!g)
	{
        if(b > 1 && r > 1)
		{
            printf("BGR");
            return 0;
        }
        if(b == 1 && r == 1)
		{
            printf("G");
            return 0;
        }
        if(b == 1)
		{
            printf("BG");
            return 0;
        }
        else
		{
            printf("GR");
            return 0;
        }
    }
    if(b > 1 && g > 1)
	{
        printf("BGR");
        return 0;
    }
    if(b == 1 && g == 1)
	{
        printf("R");
        return 0;
    }
    if(b == 1)
	{
        printf("BR");
        return 0;
    }
    else
	{
        printf("GR");
        return 0;
    }
	return 0;
}

#include<bits/stdc++.h>
#define ll long long int
#define endl "\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;

string ans = "";
ll dp[205][205][205];
void helper(ll r, ll g ,ll b)
{
    if(r + g + b == 1)
    {
        if(b)
        ans += 'B';
        if(g)
        ans += 'G';
        if(r)
        ans += 'R';
        return;
    }
    if(dp[r][g][b])
    return;
    if(r >= 2)
    helper(r-1, g, b);

     if(g >= 2)
    helper(r, g-1, b);

    if(b >= 2)
    helper(r, g, b-1);

    if(g >= 1 && r >= 1)
    helper(r-1, g-1, b+1);

    if(b >= 1 && r >= 1)
    helper(r-1, g+1, b-1);

    if(g >= 1 && b >= 1)
    helper(r+1, g-1, b-1);
    dp[r][g][b] = 1;

}

int main()
{
    IOS

    ll n;
    cin >> n;

    string s;
    cin >> s;

    ll i;
    ll r = 0, g = 0, b = 0;
    for(i = 0; i < n; i++)
    {
        if(s[i] == 'R')
        r++;
        if(s[i] == 'G')
        g++;
        if(s[i] == 'B')
        b++;
    }

    helper(r,g,b);
    n = ans.size();
    r = g = b = 0;

    for(i = 0; i < n; i++)
    {
        if(ans[i] == 'R')
        r++;
        if(ans[i] == 'B')
        b++;
        if(ans[i] == 'G')
        g++;
    }
    ans = "";
    if(b >= 1)
    ans += "B";
    if(g >= 1)
    ans += "G";
    if(r >= 1)
    ans += "R";
    cout << ans << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,a=0,b=0,c=0;
cin>>n;
string s;
cin>>s;
for(int i=0;i<n;i++)
{if(s[i]=='R'){a=a+1;}
if(s[i]=='G'){b=b+1;}
if(s[i]=='B'){c=c+1;}
}
if(a==n or b==n or c==n){cout<<s[0]<<endl;}
else if((a>=1 and b>=1 and c>=1)or(a>=2 and (b>=2 or c>=2)) or(b>=2 and (a>=2 or c>=2)) or(c>=2 and (a>=2 or b>=2)))
{cout<<"BGR";}
else if(a==1 and b==1 and c==0){cout<<"B";}
else if(a==1 and b==0 and c==1){cout<<"G";}
else if(a==0 and b==1 and c==1){cout<<"R";}
else if(a>=2 and (b<2 or c<2)){cout<<"BG";}
else if(b>=2 and (c<2 or a<2)){cout<<"BR";}
else if(c>=2 and(a<2 or b<2)){cout<<"GR";}

return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    string s;
    cin>>s;
    int r=0,b=0,g=0;
    for(int i=0;i<s.length();i++){
        if(s[i]=='B')b++;
        else if(s[i]=='G')g++;
        else r++;
    }
    //order
    if(b==n)cout<<"B";
    else if(r==n)cout<<"R";
    else if(g==n)cout<<"G";
    else if(n==2){
        if(b==0)cout<<"B";
        else if(g==0)cout<<"G";
        else if(r==0)cout<<"R";
    }else if((b>=2&&r>=2) || (r>=2&&g>=2) || (g>=2&&b>=2))cout<<"BGR";
    else if(b>=1 && r>=1 && g>=1)cout<<"BGR";
    else if(b==1 && r>1)cout<<"BG";
    else if(b==1 && g>1)cout<<"BR";
    else if(r==1 && b>1)cout<<"GR";
    else if(r==1 && g>1)cout<<"BR";
    else if(g==1 && b>1)cout<<"GR";
    else if(g==1 && r>1)cout<<"BG";
}

#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:1000000000")
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <stdio.h>
#include <vector>
#include <map>
#include <queue>
#include <time.h>
#include <memory.h>
#include <cassert>

#define ll long long
#define ld long double
#define mp make_pair
#define pii pair<int, int>
#define pi 3.141592653589793238462643383279

ll gcd(ll a, ll b) {
	if (b == 0)
		return a;
	else
		return gcd(b, a % b);
}

ll lcm(ll a, ll b) { return (((a*b) / gcd(a, b))); }

ll phi(ll n){
	ll result = n;
	for (ll i = 2; i*i <= n; i++) {
		if (n % i == 0) {
			while (n % i == 0) n /= i;
			result -= result / i;
		}
	}
	if (n > 1) result -= result / n;
	return result;
}

ll binpow(ll a, ll n, ll c) {
	ll res = 1;
	while (n) {
		if (n & 1)
			res *= a;
		res %= c;
		a *= a;
		a %= c;
		n >>= 1;
	}
	res = (res + c) % c;
	return res;
}
#define inf 1000000007

#define eps 0.0001
#define ls (v << 1)
#define rs ((v << 1)+1)

void nxi(int& n){
	bool min = 0; char c; n = 0;
	while ((c = getc(stdin)) && c <= 32);
	if (c == '-') min = 1; else n = c - 48;
	while ((c = getc(stdin)) && c>32) n = (n << 3) + (n << 1) + c - 48;
	if (min) n = -n;
}

void prl(int n){
	if (n == 0) { puts("0"); return; }
	if (n<0) { putchar('-'); n = -n; }
	static int s[10];
	int top = 0;
	while (n>0) s[top++] = n % 10, n /= 10;
	while (top--) putchar(s[top] + 48);
	puts("");
}

#define x1 first
#define y1 second
#define x0 privet
#define y0 pak
#define pll pair<ll, ll>
#define X first
#define Y second
#define vi vector<ll>
#define matrix vector<vi>
#define try freagoijf

#define rank ranggggg
#define in(n) scanf("%d",&(n));
#define in2(n,m) scanf("%d %d",&(n),&(m));
#define in3(n,m,k) scanf("%d %d %d",&(n),&(m),&(k));
#define fs first
#define sc second
using namespace std;

const int nmax = 210;
int g[nmax][nmax], a[nmax], n, k;

int solve(int pos, int rest){
  if (rest<0) return 0;
  if (pos==0) {
     return 1;
  }
  int pp=0;
  for (int i=1; i<=pos; i++) {
     pp+=solve(i-1, rest-g[i][pos]);
  }
  return pp;
}

int main()
{
srand(time(0));
   #ifndef ONLINE_JUDGE
   freopen("i.in", "r",stdin);
   #endif

    int n,i,j,k;
 cin>>n;
 string s;
 cin>>s;
 if(n==1)
 {
 	cout<<s;
 }
 else if(n==2)
 {
 	int r=0,g=0,b=0;
 	for(i=0;i<2;i++)
 	{
 		if(s[i]=='R')
 		{
 			r++;
 		}
 		else if(s[i]=='G')
 		{
 			g++;
 		}
 			else if(s[i]=='B')
 		{
 			b++;
 		}
 	}
 	if(r==2||(g==1&&b==1))
 	{
 		cout<<"R";
 	}
 else if(g==2||(r==1&&b==1))
 	{
 		cout<<"G";
 	}
 	else if(b==2||(g==1&&r==1))
 	{
 		cout<<"B";
 	}
 }
 else if(n>=3)
 {
 	int r=0,g=0,b=0;
 	for(i=0;i<n;i++)
 	{
 		if(s[i]=='R')
 		{
 			r++;
 		}
 		else if(s[i]=='G')
 		{
 			g++;
 		}
 			else if(s[i]=='B')
 		{
 			b++;
 		}
 	}
 	if(r==n)
 	{
 		cout<<"R";
 	}
 else if(g==n)
 	{
 		cout<<"G";
 	}
 	else if(b==n)
 	{
 		cout<<"B";
 	}
 	else if(r>=1&&g>=1&&b>=1)
 	{
 		cout<<"BGR";
 	}
 	else if(r==n-1&&g==1)
 	{
 		cout<<"BG";
 	}
 	else if(r==n-1&&b==1)
 	{
 		cout<<"BG";
 	}
 	else if(b==n-1&&g==1)
 	{
 		cout<<"GR";
 	}
 	else if(b==n-1&&r==1)
 	{
 		cout<<"GR";
 	}
 	else if(g==n-1&&r==1)
 	{
 		cout<<"BR";
 	}
 		else if(g==n-1&&b==1)
 	{
 		cout<<"BR";
 	}
 	else
 	{
 		cout<<"BGR";
 	}

 }

   return 0;
}

//Smile for the future :)
#include <bits/stdc++.h>
#define foreach(i,x) for(type(x)i=x.begin();i!=x.end();i++)
#define FOR(ii,aa,bb) for(int ii=aa;ii<=bb;ii++)
#define ROF(ii,aa,bb) for(int ii=aa;ii>=bb;ii--)
#define st first
#define nd second
#define mp make_pair
#define y1 asdasdasdasd
#define pb push_back
#define type(x) __typeof(x.begin())
using namespace std;
typedef pair < int ,int > pii;

int n,r,g,b;
string str;

bool f(int a,int b, int c){
	if(!b and !c) return true;
	if(c and b) return true;
	c=max(b,c);
	if(!a) return false;
	if(c>1) return true;

}

main(){
	cin>>n>>str;

	FOR(i,0,n-1){
		if(str[i]=='R') r++;
		if(str[i]=='G') g++;
		if(str[i]=='B') b++;

	}

		if(f(b,g,r)) printf("B");
		if(f(g,r,b)) printf("G");
		if(f(r,g,b)) printf("R");
		cout<<endl;
	}

#include<iostream>
#include<string>
#include<vector>
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<sstream>
#include<set>
#include<map>
#include<climits>
#include<cstring>
#include<list>
#include<fstream>
#include<stack>
#include<iomanip>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
LL mod=1e12+7;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin>>n;

    string s;
    cin>>s;

    int r=0, g=0, b=0;

    for(int i=0; i<s.length(); i++)
    {
        if(s[i]=='R')
            r++;
        else if(s[i]=='B')
            b++;
        else g++;
    }

    if(b>0&&r==0&&g==0)
    {
        cout<<"B";

        return 0;
    }

    if(r>0&&g==0&&b==0)
    {
        cout<<"R";

        return 0;
    }

    if(g>0&&r==0&&b==0)
    {
        cout<<"G";

        return 0;
    }

    if( (r>1&&g>1)||(b>1&&r>1)||(g>1&&b>1)||(r>0&&b>0&&g>0) )
    {
        cout<<"BGR";
        return 0;
    }

    if(g==0&&b==1)
    {
        if(r>1)
            cout<<"BG";
        else cout<<"G";

        return 0;
    }

    if(g==0&&r==1)
    {
        if(b>1)
            cout<<"GR";
        else cout<<"G";

        return 0;
    }

    if(r==0&&b==1)
    {
        if(g>1)
            cout<<"BR";
        else cout<<"R";

        return 0;
    }

    if(r==0&&g==1)
    {
        if(b>1)
            cout<<"GR";
        else cout<<"R";

        return 0;
    }

    if(b==0&&r==1)
    {
        if(g>1)
            cout<<"BR";
        else cout<<"B";

        return 0;
    }

    if(b==0&&g==1)
    {
        if(r>1)
            cout<<"BG";
        else cout<<"B";

        return 0;
    }

}

# include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int u[201][201][201];
int cnt[256];
string a;
queue < pair < int, pair < int, int > > > q;

void Relax(int r, int g, int b){
    if(!u[r][g][b]){
        u[r][g][b] = 1;
        q.push({r, {g, b}});
    }
}

main(){
    int n;
    cin >> n >> a;
    for(char i : a)
        ++cnt[i];
    Relax(cnt['R'], cnt['G'], cnt['B']);

    while(!q.empty()){
        pair < int, pair < int, int > > v = q.front();
        q.pop();
        int r = v.first;
        int g = v.second.first;
        int b = v.second.second;
        u[r][g][b] = 1;
        if(r >= 2)
            Relax(r - 1, g, b);
        if(g >= 2)
            Relax(r, g - 1, b);
        if(b >= 2)
            Relax(r, g, b - 1);
        if(r && g)
            Relax(r - 1, g - 1, b + 1);
        if(r && b)
            Relax(r - 1, g + 1, b - 1);
        if(g && b)
            Relax(r + 1, g - 1, b - 1);
    }
    string ans;
    if(u[1][0][0]) ans += 'R';
    if(u[0][1][0]) ans += 'G';
    if(u[0][0][1]) ans += 'B';
    sort(ans.begin(), ans.end());
    cout << ans;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define all(v) v.begin(), v.end()
#define mp make_pair
#define pb push_back
#define f first
#define s second

int dp[205][205][205];

void dfs(int r, int g, int b){
	if(dp[r][g][b]) return;
	dp[r][g][b] = 1;
	if(r >= 2) dfs(r - 1, g, b);
	if(g >= 2) dfs(r, g - 1, b);
	if(b >= 2) dfs(r, g, b - 1);
	if(r && g) dfs(r - 1, g - 1, b + 1);
	if(r && b) dfs(r - 1, g + 1, b - 1);
	if(b && g) dfs(r + 1, g - 1, b - 1);
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	//freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
	int n;
	cin >> n;
	string t;
	cin >> t;
	int r = 0, g = 0, b = 0;
	for(int i = 0; i < n; i++){
		if(t[i] == 'B') b++;
		if(t[i] == 'G') g++;
		if(t[i] == 'R') r++;
	}
	dfs(r, g, b);
	if(dp[0][0][1]) putchar('B');
	if(dp[0][1][0]) putchar('G');
	if(dp[1][0][0]) putchar('R');
	return 0;
}
/*
Things to look out for:
	- Integer overflows
	- Array bounds
	- Special cases
Be careful!
*/

//84104971101048411497 - Can you guess what does this mean?
using namespace std;
#include <bits/stdc++.h>
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i,  r, l) for(int i = (r); i >= (l); --i)
#define fto(i, l, r) for(int i = (l); i <= (r); ++i)
#define forit(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define fordit(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define ll long long
#define maxN 200005

template <class T>
T min(T a, T b, T c) {
    return min(a, min(b, c));
}

template <class T>
T max(T a, T b, T c) {
    return max(a, max(b, c));
}

string s, t = "", ans;
int n, cnt[256];
set<string> avail;
queue<string> q;

int main () {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #endif // ONLINE_JUDGE

    cin >> n;
    cin >> s;
    fto(i, 0, n-1) {
        if (cnt[s[i]] < 5) {
            t += s[i];
            ++cnt[s[i]];
        }
    }
//    debug(t);
    sort(t.begin(), t.end());
    q.push(t);
    while (!q.empty()) {
        string u = q.front(); q.pop();
        int n = u.length();
        if (n == 1) ans += u;
        fto(i, 0, n-1) {
            fto(j, i+1, n-1) {
                string v = u;
                v.erase(j, 1);
                v.erase(i, 1);
                if (u[i] == u[j]) v += u[i];
                else {
                    char c = 'R'+'G'+'B'-u[i]-u[j];
                    v += c;
                }
                sort(v.begin(), v.end());
                if (avail.find(v) == avail.end()) {
                    q.push(v);
                    avail.insert(v);
                }
            }
        }
    }
    sort(ans.begin(), ans.end());
    cout << ans;

    return 0;
}

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define zad tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define p push
#define mkp make_pair
#define ff first
#define PLL pair<ll,ll>
#define IOS ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);srand(time(NULL));

int main()
{
    IOS
    ll t=1;
    //cin >> t;
    while(t--)
    {
      ll n;
      cin >> n;
      string s;
      cin >> s;
      map<char,ll> m;
      for(ll i=0;i<n;i++)
      {
          m[s[i]]++;
      }
      if(m['R'] && !m['B'] && !m['G']) cout<<"R\n";
      else if(!m['R'] && m['B'] && !m['G']) cout<<"B\n";
      else if(!m['R'] && !m['B'] && m['G']) cout<<"G\n";
      else if(m['R'] && m['B'] && m['G']) cout<<"BGR\n";
      else
      {
         map<char,ll> m2;
         if(m['R'] && m['B'] && !m['G'])
         {
             m2['G']=1;
             if(m['R']!=1 && m['B']!=1)
             {
                 m2['R']=1;
                 m2['B']=1;
             }
             else if(m['R']!=1)
             {
                 m2['B']=1;
             }
             else if(m['B']!=1)
             {
                 m2['R']=1;
             }
         }
         if(m['R'] && !m['B'] && m['G'])
         {
             m2['B']=1;
             if(m['R']!=1 && m['G']!=1)
             {
                 m2['R']=1;
                 m2['G']=1;
             }
             else if(m['R']!=1)
             {
                 m2['G']=1;
             }
             else if(m['G']!=1)
             {
                 m2['R']=1;
             }

         }
         else if(!m['R'] && m['B'] && m['G'])
         {
             m2['R']=1;
             if(m['G']!=1 && m['B']!=1)
             {
                 m2['G']=1;
                 m2['B']=1;
             }
             else if(m['G']!=1)
             {
                 m2['B']=1;
             }
             else if(m['B']!=1)
             {
                m2['G']=1;
             }
         }

         if(m2['B']==1) cout<<"B";
         if(m2['G']==1) cout<<"G";
         if(m2['R']==1) cout<<"R";

      }

    }
}

#include<stdio.h>
#include<string.h>

const int maxn=210;
char str[maxn];
int main()
{
	int n,i,j,k;
	scanf("%d",&n);
	scanf("%s",str);
	int r=0,g=0,b=0;
	int len=strlen(str);
	for(i=0;i<len;++i){
		if(str[i]=='R')r++;
		else if(str[i]=='G')g++;
		else b++;
	}
	if(r!=0&&g==0&&b==0){
		printf("R\n");
	}else if(r==0&&g!=0&&b==0){
		printf("G\n");
	}else if(r==0&&g==0&&b!=0){
		printf("B\n");
	}else if(len==2){
		if(r==1&&g==1)printf("B\n");
		else if(r==1&&b==1)printf("G\n");
		else if(g==1&&b==1)printf("R\n");
	}else if(r!=0&&g!=0&&b!=0){
		printf("BGR\n");
	}else if(r==0){
		if(g>b){
			if(b==1)
			printf("BR\n");
			else printf("BGR\n");
		}else if(g<b){
			if(g==1)
			printf("GR\n");
			else printf("BGR\n");
	}else
		printf("BGR\n");
	}else if(g==0){
		if(r>b){
			if(b==1)
				printf("BG\n");
			else
				printf("BGR\n");
		}else if(r<b){
			if(r==1)
				printf("GR\n");
			else printf("BGR\n");
		}
			else printf("BGR\n");
	}else if(b==0){
		if(r>g){
			if(g==1)
				printf("BG\n");
			else
				printf("BGR\n");
	}else if(r<g){
			if(r==1)
				printf("BR\n");
			else printf("BGR\n");

	}else
		printf("BGR\n");
	}

	return 0;
}

#include <iostream>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <vector>
#include <iomanip>
#include <queue>

#define f first
#define s second

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    int n,r=0,g=0,b=0;
    string s;
    cin>>n>>s;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='G')
        {
            g++;
        }
        if(s[i]=='R')
        {
            r++;
        }
        if(s[i]=='B')
        {
            b++;
        }
    }
    //cout<<r<<" "<<g<<" "<<b<<endl;
    if(r+g+b==max(r,max(g,b)))
    {
        if(r>0)
        {
            cout<<"R";
            return 0;
        }
        if(g>0)
        {
            cout<<"G";
            return 0;
        }
        if(b>0)
        {
            cout<<"B";
            return 0;
        }
    }
    if(r+g+b==2)
    {
        if(r==1 && g==1)
        {
            cout<<"B";
            return 0;
        }
        if(g==1 && b==1)
        {
            cout<<"R";
            return 0;
        }
        if(b==1 && r==1)
        {
            cout<<"G";
            return 0;
        }
    }
    if((r==1||g==1||b==1) && min(r,min(g,b))==0)
    {
        if(r==1)
        {
            if(b==0)
            {
                cout<<"BR";
                return 0;
            }
            if(g==0)
            {
                cout<<"GR";
                return 0;
            }
        }
        if(g==1)
        {
            if(b==0)
            {
                cout<<"BG";
                return 0;
            }
            if(r==0)
            {
                cout<<"GR";
                return 0;
            }
        }
        if(b==1)
        {
            if(r==0)
            {
                cout<<"BR";
                return 0;
            }
            if(g==0)
            {
                cout<<"BG";
                return 0;
            }
        }
    }
    cout<<"BGR";
    return 0;
}

#include <map>
#include <cmath>
#include <string>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

#define ff first
#define ss second
#define _N 100005
#define mk make_pair
#define pb push_back

typedef long long ll;

int n, i, R, G, B;

char S[1000];

int main () {
	scanf ("%d", &n);
	scanf ("%s", S);
	for (i = 0; i < n; i ++) {
		if (S[i] == 'R') R ++;
		if (S[i] == 'G') G ++;
		if (S[i] == 'B') B ++;
	}
	if (n == 1) {
		printf ("%c", S[0]); return 0;
	}
		if (!R && !B) {printf ("G"); return 0;}
		if (!B && !G) {printf ("R"); return 0;}
		if (!R && !G) {printf ("B"); return 0;}
	if (n >= 3) {
		if (!R && B == 1) {
			printf ("BR\n");
			return 0;
		}
		if (!R && G == 1) {
			printf ("GR\n");
			return 0;
		}
		if (!G && B == 1) {
			printf ("BG\n");
			return 0;
		}
		if (!G && R == 1) {
			printf ("GR\n");
			return 0;
		}
		if (!B && R == 1) {
			printf ("BR\n");
			return 0;
		}
		if (!B && G == 1) {
			printf ("BG\n");
			return 0;
		}
		printf ("BGR\n");
		return 0;
	}
	if (R && B) printf ("G");
	if (R && G) printf ("B");
	if (G && B) printf ("R");
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI >    VVI;
typedef long long int   LL;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))

#define din(n) int n; scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define llin(n) long long n; scanf("%lld",&n)
#define llout(n) printf("%lld\n",n)
#define strin(s,l) char s[l]; scanf("%s",s)
#define strout(n) printf("%s\n",n)
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
        cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
//r,g,b
char dp[200][200][200];
set<char> ans;
void call(int r,int g,int b)
{
	//trace(r,g,b);
	if(dp[r][g][b]!=0) return;
	if(r+g+b < 2)
	{
		if(r) ans.insert('R');
		if(g) ans.insert('G'); /*trace("es");*/
		if(b) ans.insert('B');
		dp[r][g][b] = (r) + (g)*2 + (b)*4;
	//	trace(r,g,b);
		return;
	}
	if(r>=1 && g>=1) call(r-min(r,g),g-min(r,g),b+min(r,g));
	if(g>=1 && b>=1) call(r+min(b,g),g-min(b,g),b-min(b,g));
	if(r>=1 && b>=1) call(r-min(r,b),g+min(r,b),b-min(r,b));
	if(r>=2) call(1,g,b);
	if(g>=2) call(r,1,b);
	if(b>=2) call(r,g,1);
	//return;
}
int main(void)
{
	din(n);
	string s;
	cin>>s;
	int g=0;
	int b=0;
	int r=0;
	//set<char> ans;

	for (int i = 0; i < n; ++i)
	{
		if(s[i]=='G') g++;
		if(s[i]=='B') b++;
		if(s[i]=='R') r++;
		/* code */
	}
	call(r,g,b);
	//trace(ans.size());
	for(char x: ans)
	{
		cout<<x;
	}
	cout<<endl;

    return(0);
}

#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <ctime>
#include <iomanip>
#include <iterator>
#include <set>
#include <string>
#include <stack>
#include <cmath>
#include <stdio.h>
#include <cstring>

#define ii <int , int >

#define mp make_pair
#define all(v) v.begin(),v.end()
#define loop (i, n) for (int i = 0; i < n; i++)
#define pb push_back
#define sz(v) (int )v.size()
#define X first
#define Y second

using namespace std;

typedef long long ll;
typedef vector <int > vi;
typedef vector <vi > vvi;
typedef pair ii pii;
typedef vector <pii > vii;
typedef map ii mii;
typedef set <int > si;
typedef multiset <int > msi;
typedef multimap <int, int > mmi;
typedef vector <ll > vl;
typedef pair <ll, ll > pll;
typedef vector <pll > vll;

const ll nInf = -1000000000;
const ll pInf = 1000000000;
const ll mod = 1000000007;
const int MAXN = 1000;

void getdata();
void preproc();
void solve();
int n;
char s[MAXN];
set<pair<pii, int>> q;

int main()
{

	int t = 1;
	//scanf("%d", &t);
	for (int i = 0; i < t; i++)
	{
		getdata();
		preproc();
		solve();
	}
	return 0;
}

void getdata()
{
	scanf("%d", &n);
	scanf("%s", &s);
	int r, g, b;
	r = g = b = 0;
	for (int i = 0; i < n; i++)
	{
		if (s[i] == 'R')
			r++;
		if (s[i] == 'G')
			g++;
		if (s[i] == 'B')
			b++;
	}
	if (r > 0 && b > 0 && g > 0)
	{
		printf("BGR");
		return;
	}
	if (r > 0 && b > 0)
	{
		if (r == 1 && b == 1)
		{
			printf("G");
			return;
		}
		if (r > 1 && b > 1)
		{
			printf("BGR");
			return;
		}
		if (r == 1)
			printf("GR");
		if (b == 1)
			printf("BG");
		return;
	}

	if (g > 0 && b > 0)
	{
		if (g == 1 && b == 1)
		{
			printf("R");
			return;
		}
		if (g > 1 && b > 1)
		{
			printf("BGR");
			return;
		}
		if (g == 1)
			printf("GR");
		if (b == 1)
			printf("BR");
		return;
	}

	if (r > 0 && g > 0)
	{
		if (r == 1 && g == 1)
		{
			printf("B");
			return;
		}
		if (r > 1 && g > 1)
		{
			printf("BGR");
			return;
		}
		if (r == 1)
			printf("BR");
		if (g == 1)
			printf("BG");
		return;
	}
	if (r != 0)
		printf("R");
	if (g != 0)
		printf("G");
	if (b != 0)
		printf("B");

}

void preproc()
{

}

void solve()
{

	//int result[3]= {0, 0, 0};

	//while (!q.empty())
	//{
	//	auto f = q.begin();
	//	int r = (*f).X.X;
	//	int g = (*f).X.Y;
	//	int b = (*f).Y;

	//	q.erase(f);

	//	if (r + g + b == 1)
	//	{
	//		if (r == 1)
	//		{
	//			result[0] = 1;
	//		}
	//		if (g == 1)
	//		{
	//			result[1] = 1;
	//		}
	//		if (b == 1)
	//		{
	//			result[2] = 1;
	//		}
	//		continue;
	//	}
	//	if (result[0] + result[1] + result[2] == 3)
	//		break;

	//	if (r > 1)
	//		q.insert(mp(mp(r - 1, g), b));

	//	if (g > 1)
	//		q.insert(mp(mp(r, g - 1), b));
	//	if (b > 1)
	//		q.insert(mp(mp(r, g), b - 1));
	//	if (r > 0 && g > 0)
	//		q.insert(mp(mp(r - 1, g - 1), b + 1));
	//	if (r > 0 && b > 0)
	//		q.insert(mp(mp(r - 1, g + 1), b - 1));
	//	if (b > 0 && g > 0)
	//		q.insert(mp(mp(r + 1, g - 1), b - 1));
	//}
	//if (result[2])
	//	printf("B");
	//if (result[1])
	//	printf("G");
	//if (result[0])
	//	printf("R");

}

#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <set>
#include <time.h>
#include <cstdlib>
#include <map>
#include <string>
#include <queue>
#include <cassert>
#include <unordered_map>
#define INF 1e18
using namespace std;

int main()
{
	int n;
	cin >> n;
	string s;
	cin >> s;
	int r = 0, g = 0, b = 0;
	for(int i = 0; i < n; i++)
	{
		if(s[i] == 'R')
		{
			r++;
		}
		if(s[i] == 'G')
		{
			g++;
		}
		if(s[i] == 'B')
		{
			b++;
		}
	}

	if(r != 0 && b != 0 && g != 0)
	{
		cout << "BGR";
	}

	if(r == 0)
	{
		if(b >= 2 && g >= 2)
		{
			cout << "BGR";
		}
		if(b == 1 && g >= 2)
		{
			cout << "BR";
		}
		if(g == 1 && b >= 2)
		{
			cout << "GR";
		}
		if(g == 1 && b == 1)
		{
			cout << "R";
		}
	}
	if(b == 0)
	{
		if(r >= 2 && g >= 2)
		{
			cout << "BGR";
		}
		if(r == 1 && g >= 2)
		{
			cout << "BR";
		}
		if(g == 1 && r >= 2)
		{
			cout << "BG";
		}
		if(g == 1 && r == 1)
		{
			cout << "B";
		}
	}
	if(g == 0)
	{
		if(b >= 2 && r >= 2)
		{
			cout << "BGR";
		}
		if(b == 1 && r >= 2)
		{
			cout << "BG";
		}
		if(r == 1 && b >= 2)
		{
			cout << "GR";
		}
		if(b == 1 && r == 1)
		{
			cout << "G";
		}
	}

	if(b + g + r == r)
	{
		cout << "R";
	}
	if(b + g + r == b)
	{
		cout << "B";
	}
	if(b + g + r == g)
	{
		cout << "G";
	}
	return 0;
}

#include<cstdio>
#include<cstring>
using namespace std;
char ch[210];
int main()
{
	int n;
	scanf("%d%s", &n, ch);
	int b, g, r;
	b = g = r = 0;
	for(int i = 0; i < n; ++i)
	{
		if(ch[i]=='B') ++b;
		else if(ch[i] == 'R') ++r;
		else  ++g;
	}
	if(b && g && r)
	{
        printf("BGR");
        return 0;
    }
    if(!b && !g)
	{
        printf("R");
        return 0;
    }
    if(!b && !r)
	{
        printf("G");
        return 0;
    }
    if(!g && !r)
	{
        printf("B");
        return 0;
    }
    if(!b)
	{
        if(g > 1 && r > 1)
		{
            printf("BGR");
            return 0;
        }
        if(g == 1 && r == 1)
		{
            printf("B");
            return 0;
        }
        if(g == 1)
		{
            printf("BG");
            return 0;
        }
        else
		{
            printf("BR");
            return 0;
        }
    }
    if(!g)
	{
        if(b > 1 && r > 1)
		{
            printf("BGR");
            return 0;
        }
        if(b == 1 && r == 1)
		{
            printf("G");
            return 0;
        }
        if(b == 1)
		{
            printf("BG");
            return 0;
        }
        else
		{
            printf("GR");
            return 0;
        }
    }
    if(b > 1 && g > 1)
	{
        printf("BGR");
        return 0;
    }
    if(b == 1 && g == 1)
	{
        printf("R");
        return 0;
    }
    if(b == 1)
	{
        printf("BR");
        return 0;
    }
    else
	{
        printf("GR");
        return 0;
    }
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
string s;
ll n,countr,countg,countb;
int main()
{
    cin>>n;
    cin>>s;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='R')
            countr++;
        else if(s[i]=='G')
            countg++;
        else if(s[i]=='B')
            countb++;
    }
    //cout<<countg<<" "<<countb<<" "<<countr<<endl;
    //RGB individual cases
    if((countr!=0 && countg==0 && countb==0))
        cout<<"R"<<endl;
    else if((countg!=0 && countr==0 && countb==0))
        cout<<"G"<<endl;
    else if((countb!=0 && countg==0 && countr==0))
        cout<<"B"<<endl;
    else if(n==2)
    {
        string str="RGB";
        cout<<str[3-countg-countb*2]<<endl;
    }
    //RGB case
    else if(countg!=0 && countr!=0 && countb!=0)
        cout<<"BGR"<<endl;
    else if((countg>1 && countr>1) || (countg>1 && countb>1) || (countb>1 && countr>1))
        cout<<"BGR"<<endl;
    //RG,GB,BR cases
    else if(countr==0)
    {
        if(countb==1 && countg>1)       cout<<"BR"<<endl;
        else if(countb>1 && countg==1)  cout<<"GR"<<endl;
    }
    else if(countb==0)
    {
        if(countg==1 && countr>1)       cout<<"BG"<<endl;
        else if(countr==1 && countg>1)  cout<<"BR"<<endl;
    }
    else if(countg==0)
    {
        if(countb==1 && countr>1)       cout<<"BG"<<endl;
        else if(countr==1 && countb>1)  cout<<"GR"  <<endl;
    }
return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,a=0,b=0,c=0;
cin>>n;
string s;
cin>>s;
for(int i=0;i<n;i++)
{if(s[i]=='R'){a=a+1;}
if(s[i]=='G'){b=b+1;}
if(s[i]=='B'){c=c+1;}
}
if(a==n or b==n or c==n){cout<<s[0]<<endl;}
else if((a>=1 and b>=1 and c>=1)or(a>=2 and (b>=2 or c>=2)) or(b>=2 and (a>=2 or c>=2)) or(c>=2 and (a>=2 or b>=2)))
{cout<<"BGR";}
else if(a==1 and b==1 and c==0){cout<<"B";}
else if(a==1 and b==0 and c==1){cout<<"G";}
else if(a==0 and b==1 and c==1){cout<<"R";}
else if(a>=2 and (b<2 or c<2)){cout<<"BG";}
else if(b>=2 and (c<2 or a<2)){cout<<"BR";}
else if(c>=2 and(a<2 or b<2)){cout<<"GR";}

return 0;
}

// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("unroll-loops")

#include <bits/stdc++.h>
using namespace std;
# define fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl "\n"
#define all(v) v.begin(),v.end()
#define mod1 1000000009
#define mod 1000000007
#define Mod 998244353
#define ha "YES"
#define na "NO"
#define len(s) int(s.size())
#define pb push_back
#define eb emplace_back
#define rev(s) reverse(all(s))
typedef unsigned long long ull;
typedef long long ll;

void IO()
{
#ifndef ONLINE_JUDGE
	freopen("pracin.txt", "r", stdin);
	freopen("pracout.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
#endif
	fast;
}
// vector<bool> used;
// vector<vector<int>> adj;
// vector<int> dir[200005];
// vector<int> a, b;
//bipartite graph or not using bfs

// void bfs(int i)
// {
// 	queue<int> q;
// 	q.push(i);
// 	used[i] = 1;
// 	a.push_back(i);
// 	while (!q.empty())
// 	{	i = q.front();
// 		q.pop();
// 		for (auto vertex : adj[i])
// 		{
// 			if (used[vertex] == -1)
// 			{
// 				used[vertex] = used[i] ^ 1;
// 				if (used[vertex] == 1) a.push_back(vertex);
// 				else b.push_back(vertex);
// 				q.push(vertex);
// 			}
// 			if (used[vertex] == used[i]) {
// 				cout << -1;
// 				exit(0);
// 			}

// 		}

// 	}
// }

// fast exponention (logn)
ll binary_exponention(ll a, ll b) {
	if (b == 0)
		return 1;
	ll res = binary_exponention(a, b / 2);
	if (b % 2)
		return res * res * a % Mod;

	return res * res % Mod;

}

// Chal WA likh ab

inline void read(ll a[], int n, int which = 0)
{
	if (which)
		for (int i = 1; i <= n; i++) cin >> a[i];
	else for (int i = 0; i < n; i++) cin >> a[i];
}
inline void write(ll a[], int n, int which = 0)
{
	if (which == 0)
		for (int i = 0; i < n; i++) cout << a[i] << " ";
	else for (int i = 1; i <= n; i++) cout << a[i] << " ";
}
int dir8i[8] = { -1, -1, 0, 1, 1, 1, 0, -1};

int dir4i[4] = { -1, 0, 1, 0};
int dir4j[4] = {0, -1, 0, 1};

// To Do

// 10580 - Ransom Note
// matrix matcher uva
// extend the palindrome

void  solve()
{

	int n; cin >> n;
	string s; cin >> s;
	set<char> se;
	map<char, int> m;
	for (int i = 0; i < n; i++) se.insert(s[i]), m[s[i]]++;
	sort(all(s));
	if (len(s) == 1)
	{
		cout << s[0];
		return;
	}
	if (len(s) == 2)
	{

		if (s[0] == s[1])
			cout << s[0];
		else {
			if (s[0] == 'B' && s[1] == 'G') cout << 'R';
			else  if (s[0] == 'B' && s[1] == 'R') cout << 'G';
			else cout << "B";
		}
		return;
	}
	if (len(se) == 1)
	{
		cout<<s[0];
		return;

	}
	else if (len(se) == 3)
	{
		cout << "BGR";
	}
	else {
		if ( (m['R'] > 1 && m['G'] > 1 ) || (m['R'] > 1 && m['B'] > 1) || (m['G'] > 1 && m['B'] > 1))
		{
			cout << "BGR";
		}
		else {
			if (m['R'] && m['G'])
			{
				if (m['R'] > 1 && m['G'] > 1)
					cout << "BGR";
				else {
					if (m['R'] > 1)
						cout << "BG";
					else cout << "BR";
				}
			}
			else if (m['R'] && m['B'])
			{
				if (m['R'] > 1 && m['B'] > 1)
					cout << "BGR";
				else {
					if (m['R'] > 1)
						cout << "BG";
					else cout << "GR";
				}
			}
			else
			{
				if (m['B'] > 1 && m['G'] > 1)
					cout << "BGR";
				else {
					if (m['B'] > 1)
						cout << "GR";
					else cout << "BR";
				}
			}

		}
	}
}

int  main()
{
	IO();

	// int t; cin >> t; while (t--)
	solve();

#ifndef ONLINE_JUDGE
	cerr  << 1.0 * clock() / CLOCKS_PER_SEC << "s\n";
#endif

}

//DP : but here Brute Force
#include<bits/stdc++.h>
#define LL long long int
using namespace std;
LL rf=0,gf=0,bf=0;
void find(LL r,LL g,LL b)
{
	if(r>=2)find(r-1,g,b);
	if(g>=2)find(r,g-1,b);
	if(b>=2)find(r,g,b-1);
	if(r && g)find(r-1,g-1,b+1);
	if(r && b)find(r-1,g+1,b-1);
	if(g && b)find(r+1,g-1,b-1);
	if( r && !g && !b)rf++;
	if( g && !r && !b)gf++;
	if( b && !r && !g)bf++;
}
int main()
{
	LL n;cin>>n;
	string s,ans="";cin>>s;
	LL r=count(s.begin(),s.end(),'R');
	LL g=count(s.begin(),s.end(),'G');
	LL b=count(s.begin(),s.end(),'B');
	find(min(r,(LL)2),min(g,(LL)2),min(b,(LL)2));
	if(bf)ans+='B';
	if(gf)ans+='G';
	if(rf)ans+='R';
	cout<<ans;
}

#include <bits/stdc++.h>
using namespace std;

set<char> ans;
int b,r,g;
int n;
string s;

bool dp[205][205][205];

void go(int bb,int rr, int gg ){

	if(dp[bb][rr][gg]++)
		return;

	if(bb+rr+gg==1){
		if(bb==1)
		ans.insert('B');
		else if(rr==1)
			ans.insert('R');
		else
			ans.insert('G');
		return;
	}
	if(bb == 0 && gg == 0)
	{
		ans.insert('R');
		return;
	}
	if(gg==0 && rr==0){
		ans.insert('B');
		return;
	}
	if(rr==0&&bb==0){
		ans.insert('G');
		return;
	}
	if(bb>=2){

		go(bb-1,rr,gg);

	}
	if(gg>=2){
	go(bb,rr,gg-1);	}
	if(rr>=2){
		go(bb,rr-1,gg);
	}
	if(bb>0 && rr>0){
		go(bb-1,rr-1,gg+1);
	}
	if(bb>0 && gg>0){
				go(bb-1,rr+1,gg-1);

	}
	if(rr>0 && gg>0){
				go(bb+1,rr-1,gg-1);

	}

}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin>>n;
	cin>>s;
	for(int i=0;i<n;i++){
		if(s[i]=='B')
			b++;
		else if(s[i]=='G')
			g++;
		else
			r++;
	}
	//cout<<r<<g<<b;

	go(b,r,g);

	for(auto x:ans)
		cout<<x;

	return 0;

}

#include<iostream>
#include <vector>
#include<functional>
#include <queue>
#include <algorithm>
using namespace std;
int n, m;
#define N 100200
#define M 1001000
char str[300];
int dp[300][300][3];
int color[30];
int getColor(char ch) {
	if (ch == 'R')return 0;
	else if (ch == 'B') return 1;
	else return 2;
}
void input() {
}
void solve() {
	int i, j, k, l;
	int r = 0, g = 0, b = 0;
	for (i = 0; i < n; i++) {
		if (str[i] == 'B') {
			b++;
		}
		if (str[i] == 'R') {
			r++;
		}
		if (str[i] == 'G') {
			g++;
		}
	}
	if (g && r || r > 1 && b || g > 1 && b || !g&&!r) {
		printf("B");
	}
	if (b && r || r > 1 && g || b > 1 && g || !b && !r) {
		printf("G");
	}
	if (g && b || g > 1 && r || b > 1 && r || !g && !b) {
		printf("R");
	}
	printf("\n");
}
int main() {
	color['R' - 'A'] = 0;
	color['B' - 'A'] = 1;
	color['G' - 'A'] = 2;
	long long a, b;
	while (scanf("%d %s", &n, &str) != EOF) {
		solve();
	}
	return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
using namespace std;

int n;
string s;
int a[5];
char p[] = "BGR";

int main()
{
	cin >> n >> s;
	for (int i = 0; i < 3; i++)
		a[i] = 0;
	for (int i = 0; i < n; i++)
	{
		int x = 0;
		while(p[x] != s[i]) x++;
		a[x]++;
	}
	if (a[0] == 0 && a[1] == 0)
	{
		printf("%c\n", p[2]);
		return 0;
	}
	if (a[0] == 0 && a[2] == 0)
	{
		printf("%c\n", p[1]);
		return 0;
	}
	if (a[1] == 0 && a[2] == 0)
	{
		printf("%c\n", p[0]);
		return 0;
	}
	for (int i = 0; i < 3; i++)
	{
		if (n - a[i] > 1)
			printf("%c", p[i]);
	}
	printf("\n");

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
string s;
ll n,countr,countg,countb;
int main()
{
    cin>>n;
    cin>>s;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='R')
            countr++;
        else if(s[i]=='G')
            countg++;
        else if(s[i]=='B')
            countb++;
    }
    //cout<<countg<<" "<<countb<<" "<<countr<<endl;
    //RGB individual cases
    if((countr!=0 && countg==0 && countb==0))
        cout<<"R"<<endl;
    else if((countg!=0 && countr==0 && countb==0))
        cout<<"G"<<endl;
    else if((countb!=0 && countg==0 && countr==0))
        cout<<"B"<<endl;
    else if(n==2)//n=2 special case
    {
        string str="RGB";
        cout<<str[3-countg-countb*2]<<endl;
    }
    //RGB case
    else if(countg!=0 && countr!=0 && countb!=0)
        cout<<"BGR"<<endl;
    else if((countg>1 && countr>1) || (countg>1 && countb>1) || (countb>1 && countr>1))
        cout<<"BGR"<<endl;
    //GR,BG,BR cases
    else if(countr==0)
    {
        if(countb==1 && countg>1)       cout<<"BR"<<endl;
        else if(countb>1 && countg==1)  cout<<"GR"<<endl;
    }
    else if(countb==0)
    {
        if(countg==1 && countr>1)       cout<<"BG"<<endl;
        else if(countr==1 && countg>1)  cout<<"BR"<<endl;
    }
    else if(countg==0)
    {
        if(countb==1 && countr>1)       cout<<"BG"<<endl;
        else if(countr==1 && countb>1)  cout<<"GR"  <<endl;
    }
return 0;
}

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

bool cmp(pair<string, int>& a, pair<string, int>& b)
{
	return a.second < b.second;
}

int main()
{
	int n;
	cin >> n;
	string data;
	cin >> data;

	vector<pair<string, int> > rgb;
	rgb.push_back(pair<string, int>("R", 0));
	rgb.push_back(pair<string, int>("G", 0));
	rgb.push_back(pair<string, int>("B", 0));

	for (int i = 0; i < n; ++i)
	{
		if (data[i] == 'R') rgb[0].second++;
		else if (data[i] == 'G') rgb[1].second++;
		else rgb[2].second++;
	}
	sort(rgb.begin(), rgb.end(), cmp);

	if (rgb[0].second > 0)
	{
		cout << "BGR" << endl;
	}
	else if (rgb[1].second > 0)
	{
		if (rgb[1].second == rgb[2].second && rgb[1].second == 1)
		{
			cout << rgb[0].first << endl;
		}
		else if (rgb[1].second == 1)
		{
			if (rgb[1].first < rgb[0].first) cout << rgb[1].first << rgb[0].first << endl;
			else cout << rgb[0].first << rgb[1].first << endl;
		}
		else
		{
			cout << "BGR" << endl;
		}
	}
	else
	{
		cout << rgb[2].first << endl;
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int n;
char ch[201];
int G = 0, R = 0, B = 0;

int main() {
    scanf("%d", &n);
    scanf("%s", &ch);
    for(int i = 0; ch[i]; ++i) {
        switch(ch[i]) {
            case 'R': R++; break;
            case 'B': B++; break;
            case 'G': G++; break;
        }
    }
    if(R && B && G) {
        printf("BGR");
        return 0;
    }
    if((R >= 2 && B >= 2) || (R >= 2 && G >= 2) || (B >= 2 && G >= 2)) {
        printf("BGR");
        return 0;
    }
    if(R && !B && !G) {
        printf("R");
        return 0;
    }
    if(!R && B && !G) {
        printf("B");
        return 0;
    }
    if(!R && !B && G) {
        printf("G");
        return 0;
    }
    if(R == 1 && B == 1 && !G) {
        printf("G");
        return 0;
    }
    if(R == 1 && G == 1 && !B) {
        printf("B");
        return 0;
    }
    if(!R && B == 1 && G == 1) {
        printf("R");
        return 0;
    }
    if(R >= 2 && (G || B)) {
        printf("BG");
        return 0;
    }
    if(G >= 2 && (R || B)) {
        printf("BR");
        return 0;
    }
    if(B >= 2 && (R || G)) {
        printf("GR");
        return 0;
    }
    return 0;
}

//
//  main.cpp
//  ervb
//
//  Created by Kanak Gautam on 21/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include<iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#define pb push_back
using namespace std;
typedef long long int lli;
typedef long long ll;
int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    lli n;
    cin>>n;
    string s;
    cin>>s;
    if(s==string(n,s[0]))
    {
        cout<<s[0]<<endl;
        exit(0);
    }
    for(char c :{'B','G','R'})
    {
        if(count(s.begin(),s.end(),c)!=n-1)
        {
            cout<<c;
        }
    }
    cout<<endl;

}

#include <bits/stdc++.h>
using namespace std;

//int main(){
	//int n;
	//string s;
	//cin >> n >> s;
	//if(s == string(n,s[0])){
		//cout<<s[0];
		//return 0;
	//}
	//for(auto c : {'B','G','R'})
		//if(count(s.begin(),s.end(),c)!=n-1)
			//cout<<c;
//}

// alternate

const int nax = 205;

char sl[nax];
bool dp[nax][nax][nax];

int main(){
		int n; cin >> n;
		int A = 0 , B = 0 , C = 0;
		scanf("%s",sl);
		for(int i = 0 ; i < n ; i++){
			if(sl[i] == 'R')
				A++;
			else if(sl[i] == 'G')
				B++;
			else if(sl[i] == 'B')
				C++;
			else
				assert(false);
		}
		dp[A][B][C] = true;
		for(int s = n ; s >= 0 ; s--){
			for(int a = 0 ; a <= n ; a++){
				for(int b = 0 ; b <= n ; b++){
					int c = s-a-b;
					if(0 <= c && c <= n && dp[a][b][c]){
						if(a >= 2) dp[a-1][b][c] = true;
						if(b >= 2) dp[a][b-1][c] = true;
						if(c >= 2) dp[a][b][c-1] = true;
						if(a && b) dp[a-1][b-1][c+1] = true;
						if(a && c) dp[a-1][b+1][c-1] = true;
						if(b && c) dp[a+1][b-1][c-1] = true;
					}
				}
			}
		}
		vector<char> ans;
		if(dp[1][0][0]) ans.push_back('R');
		if(dp[0][1][0]) ans.push_back('G');
		if(dp[0][0][1]) ans.push_back('B');
		sort(ans.begin(),ans.end());
		for(char z : ans)
			cout<<z;
		puts("");
	}

#include <iostream>
#include <cstdio>

using namespace std;
#define MAX 205

int main()
{
	char c[MAX];
	char temp;
	int T;
	int count_R = 0;
	int count_G = 0;
	int count_B = 0;

	scanf("%d", &T);
	temp = getchar();
	for(int i=0;i<T;i++)
	{
		c[i] = getchar();
		if (c[i] == 'R')
			count_R++;
		else if (c[i] == 'G')
			count_G++;
		else if (c[i] == 'B')
			count_B++;
	}

	if (count_B >= 1 && count_R >= 1 && count_G >= 1)
		printf("BGR\n");
	else if (count_B == 0)
	{
		if (count_R >= 1 && count_G == 0)
			printf("R\n");
		else if (count_G >= 1 && count_R == 0)
			printf("G\n");
		else if (count_R > 1 && count_G == 1)
			printf("BG\n");
		else if (count_G > 1 && count_R == 1)
			printf("BR\n");
		else if (count_G == 1 && count_R == 1)
			printf("B\n");
		else if(count_G>1&&count_R>1)
			printf("BGR\n");

	}
	else if (count_G == 0)
	{
		if (count_B >= 1 && count_R == 0)
			printf("B\n");
		else if (count_R >= 1 && count_B == 0)
			printf("R\n");
		else if (count_B > 1 && count_R == 1)
			printf("GR\n");
		else if (count_R > 1 && count_B == 1)
			printf("BG\n");
		else if (count_R == 1 && count_B == 1)
			printf("G\n");
		else if (count_B > 1 && count_R > 1)
			printf("BGR\n");
	}
	else if (count_R == 0)
	{
		if (count_B >= 1 && count_G == 0)
			printf("B\n");
		else if (count_G >= 0 && count_B == 0)
			printf("G\n");
		else if (count_B > 1 && count_G == 1)
			printf("GR\n");
		else if (count_G > 1 && count_B == 1)
			printf("BR\n");
		else if (count_G == 1 && count_B == 1)
			printf("R\n");
		else if(count_G>1&&count_B>1)
			printf("BGR\n");
	}

	return 0;
}

#include<iostream>
#include<functional>
#include<algorithm>
#include<cstring>
#include<string>
#include<vector>
#include<cstdio>
#include<cmath>
#include<map>
using namespace std;
#define CRL(a) memset(a,0,sizeof(a))
typedef unsigned __int64 LL;
typedef  __int64 ll;
#define CMP bool cmp(const node& a,const node& b){	return a.R<b.R||(a.R==b.R&&a.L<b.L); }
const int T = 503000;
const int mod = 1000000007;

int B,R,G;

int main()
{
#ifdef zsc
    freopen("input.txt","r",stdin);
#endif

	int n,m,i,j,k;
	char s[500];

	while(~scanf("%d",&n))
	{
		B = G = R = 0;
		scanf("%s",&s);
		for(i=0;s[i];++i){
			if(s[i] == 'B')B++;
			if(s[i] == 'G')G++;
			if(s[i] == 'R')R++;
		}
		if(B==0&&G==0)printf("R\n");
		else if(B==0&&R==0)printf("G\n");
		else if(G==0&&R==0)printf("B\n");

		else if(R==0&&B==1&&G==1)printf("R\n");
		else if(G==0&&B==1&&R==1)printf("G\n");
		else if(B==0&&G==1&&R==1)printf("B\n");

		else if(B==0&&G==1||G==0&&B==1)printf("BG\n");
		else if(R==0&&B==1||B==0&&R==1)printf("BR\n");
		else if(R==0&&G==1||G==0&&R==1)printf("GR\n");

		else if(R+B+G<4&&G==2)printf("BR\n");
		else if(R+G+B<4&&R==2)printf("BG\n");
		else if(R+G+B<4&&B==2)printf("GR\n");
		else printf("BGR\n");
	}

    return 0;
}

using namespace std;

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <unordered_map>
#include <sstream>
#include <set>
#include <unordered_set>
#include <algorithm>
#include <tuple>
#include <queue>

using namespace std;

void solve() {
	int n;
	string s;
	cin >> n;
	cin >> s;
	//scanf("%d\n", &n);
	int B = 0, G = 0, R = 0;
	for (int i = 0; i < n; ++i) {
		char c = s[i];
		//scanf("%c", &c);
		switch (c) {
		case 'R':
			R++;break;
		case 'G':
			G++;break;
		case 'B':
			B++;break;
		}
	}

	vector< vector< vector<bool > > > d(201, vector< vector< bool > > (201, vector<bool> (201, false) ) );
	d[R][G][B] = true;

	for (int sum = n; sum >= 0; --sum) {
		for (int r = 0; r <= sum; ++r)
			for (int g = 0; g <= sum - r; ++g) {
				int b = sum - r - g;
				if (d[r][g][b]) {
					if (r >= 2)
						d[r - 1][g][b] = true;
					if (g >= 2)
						d[r][g - 1][b] = true;
					if (b >= 2)
						d[r][g][b - 1] = true;
					if (r >= 1 && g >= 1)
						d[r - 1][g - 1][b + 1] = true;
					if (r >= 1 && b >= 1)
						d[r - 1][g + 1][b - 1] = true;
					if (g >= 1 && b >= 1)
						d[r + 1][g - 1][b - 1] = true;
				}
			}
	}
	string ans;
	if (d[0][0][1])
		ans.append("B");
	if (d[0][1][0])
		ans.append("G");
	if (d[1][0][0])
		ans.append("R");
	cout << ans;
}

int main() {
#ifdef LANGO
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    solve();
    return 0;
}

#include <iostream>
#include <stdio.h>
#include <numeric>
#include <queue>
#include <string>
#include <cmath>
#include <vector>
#include <deque>
#include <iomanip>
#include <set>
#include <queue>
#include <bitset>
#include <iomanip>
#include <map>
#include <string.h>
#include <stack>
#include <algorithm>

using namespace std;

char input[1000];

int main()
{
	int i , j , n;
	while (scanf("%d" , &n) != EOF)
	{
		scanf("%s" , input);
		int cnt1 = 0 , cnt2 = 0 , cnt3 = 0;
		for (i = 0;i < n;i ++)
		{
			if (input[i] == 'R')
				cnt1 ++;
			else if (input[i] == 'G')
				cnt2 ++;
			else
				cnt3 ++;
		}
		// 进行处理
		// R: cnt1 , G: cnt2 , B: cnt3
		if (cnt1 == cnt1 + cnt2 + cnt3)
			printf("R\n");
		else if (cnt2 == cnt1 + cnt2 + cnt3)
			printf("G\n");
		else if (cnt3 == cnt1 + cnt2 + cnt3)
			printf("B\n");
		else
		{
			// 存在两个或者以上的
			if (cnt1 == 0)
			{
				if (cnt2 == 1 && cnt3 == 1)
					printf("R\n");
				else if (cnt2 == 1)
					printf("GR\n");
				else if (cnt3 == 1)
					printf("BR\n");
				else
					printf("BGR\n");
			}
			else if (cnt2 == 0)
			{
				if (cnt1 == 1 && cnt3 == 1)
					printf("G\n");
				else if (cnt1 == 1)
					printf("GR\n");
				else if (cnt3 == 1)
					printf("BG\n");
				else
					printf("BGR\n");
			}
			else if (cnt3 == 0)
			{
				if (cnt1 == 1 && cnt2 == 1)
					printf("B\n");
				else if (cnt1 == 1)
					printf("BR\n");
				else if (cnt2 == 1)
					printf("BG\n");
				else
					printf("BGR\n");
			}
			// 三个都存在
			else
				printf("BGR\n");
		}
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push back
#define mp make_pair
int main()
{
    ll int N,r,b,g,i;
    string str;
    cin>>N;
    cin>>str;
    r=b=g=0;
    for(i=0;i<N;i++)
    {
        if(str[i]=='R')
        r+=1;
        else if(str[i]=='G')
        g+=1;
        else
        b+=1;
    }
    if(r>=1&&g>=1&&b>=1)
    cout<<"BGR"<<endl;
    else if(r>=1&&g==0&&b==0)
    cout<<"R"<<endl;
    else if(r==0&&g>=1&&b==0)
    cout<<"G"<<endl;
    else if(r==0&&g==0&&b>=1)
    cout<<"B"<<endl;
        else if(r==1&&g==1)
            cout<<"B";
        else if(r==1&&b==1)
            cout<<"G";
        else if(b==1&&g==1)
            cout<<"R";
        else if(r>=2&&g==1)
            cout<<"BG";
        else if(r==1&&g>=2)
            cout<<"BR";
        else if(r>=2&&g>=2)
            cout<<"BGR";
        else if(r>=2&&b==1)
            cout<<"BG";
        else if(r==1&&b>=2)
            cout<<"GR";
        else if(r>=2&&b>=2)
            cout<<"BGR";
        else if(b>=2&&g==1)
            cout<<"GR";
        else if(b==1&&g>=2)
            cout<<"BR";
        else if(b>=2&&g>=2)
            cout<<"BGR";
    return 0;
}

//#define  _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<map>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<cmath>
#include<stack>
#include<math.h>
#include<set>
#include<string>
#include<cstring>
#include<queue>
#include<complex>
#include<assert.h>
#include<math.h>
#include<memory.h>
#include<sstream>
#include<cstdio>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define repi(i,a,n) for(int i=a;i<n;i++)
#define INF (0x7fffffff)
#define mp make_pair
#define fastIO ios::sync_with_stdio(false)
#define read freopen("in.in","r",stdin)
#define write freopen("out.out","w",stdout)
#define scf(xx) scanf("%d",&xx)
#define All(a) a.begin(), a.end()

typedef long long ll;
typedef vector<int> vi;
typedef pair<ll, ll> ii;
typedef long double ld;

int main(){
	//read; write;

	char c;; int n;
	cin >> n;
	vi v(3, 0);
	rep(i, n){
		cin >> c;
		if (c == 'R')v[0]++;
		else if (c == 'G')v[1]++;
		else v[2]++;
	}
	if (v[0] && v[1] && v[2]) cout << "BGR";
	else if (n == 2){
		if (v[0] && v[1]) cout << "B";
		else if (v[0] && v[2])cout << "G";
		else if (v[2] && v[1])cout << "R";
		else if (v[0])cout << "R";
		else if (v[1])cout << "G";
		else cout << "B";
	}
	else if (v[0] && v[1]) {
		if (v[0]>1 && v[1]>1)cout << "BGR";
		else if (v[0] > 1)cout << "BG";
		else cout << "BR";
	}
	else if (v[0] && v[2]) {
		if (v[0]>1 && v[2]>1)cout << "BGR";
		else if (v[0] > 1)cout << "BG";
		else cout << "GR";
	}
	else if (v[1] && v[2]) {
		if (v[1]>1 && v[2]>1)cout << "BGR";
		else if (v[1] > 1)cout << "BR";
		else cout << "GR";
	}

	else if (v[0])cout << "R";
	else if (v[1])cout << "G";
	else cout << "B";
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair <int,int> PII;
typedef pair <ll, ll> PLL;
typedef pair <int,string> PIS;
typedef vector <int> vec;
typedef priority_queue<int> PQ;
/* #define input 1 */
#define endl '\n'
#define debug(x) cout<<#x<<": "<<x<<endl
#define pi 3.141592653589793
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(ar) ar.begin(), ar.end()
#define sz(x) (int)(x).size()
#define len(x) (int)x.length()
#define rep(a,b,c) for(int a=b; a<c; a++)
#define fori(z,n)  for(int i=z;i<n;i++)
#define fork(z,n)  for(int k=z;k<n;k++)
#define forii(z,n) for(int i=z;i<=n;i++)
#define forkk(z,n) for(int k=z;k<=n;k++)
const int mod = 1e9 + 7;
int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}
string trim(const string& str) {
    size_t first = str.find_first_not_of(' ');
    if (string::npos == first)
    {
        return str;
    }
    int last = str.find_last_not_of(' ');
    return str.substr(first, (last - first + 1));
}
int main() {
    #ifdef input
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    std::ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cout.precision(15);
    int n;cin>>n;
    string str;cin>>str;
    int r = 0, g = 0, b = 0;
    fori(0,n) {
        if(str[i] == 'R') r++;
        else if(str[i] == 'G') g++;
        else b++;
    }
    vector<int> arr = {r, g, b};
    sort(all(arr), greater<int>());
    int x, y, z;
    string ans ="";
    x = arr[0];y = arr[1];z = arr[2];
    if(y == 0){
        ans = str[0];
    }
    else if(z != 0) ans = "RGB";
    else {
        if(y > 1) {
            ans = "RGB";
        }
        else if(x == 1 and y == 1) {
            char ch = 'R' + 'G' + 'B';
            char temp = ch - str[0] - str[1];
            ans = temp;
        }
        else {
            if(r > 1) {
                ans = "BG";
            }
            else if(b > 1) {
                ans = "RG";
            }
            else {
                ans = "RB";
            }
        }
    }
    sort(all(ans));
    cout<<ans<<endl;
    cerr<<"Time elapsed"<<1.0*clock()/CLOCKS_PER_SEC<<"s\n";
    return 0;
}

#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <vector>
#include <stack>

using namespace std;
typedef long long ll;

int dp[201][201][201];
bool ar = false, ag = false, ab = false;

struct hd{
    int r,g,b;
};
stack<hd> st;

void push(int r, int g, int b){
    if(dp[r][g][b] != -1)return;
    dp[r][g][b] = 1;
    st.push({r,g,b});
}

int32_t main(){
    ios_base::sync_with_stdio(false);cin.tie(nullptr); cout.tie(nullptr);
    memset(dp,-1,sizeof dp);

    cin >> *(new int);
    string in; cin >> in;

    int r = 0, g = 0, b = 0;
    for(char c: in){
        if(c == 'B')b++;
        else if(c =='G')g++;
        else if(c == 'R')r++;
    }

    push(r,g,b);

    while(!st.empty()){
        hd f = st.top(); st.pop();
        if(dp[f.r][f.g][f.b])
        if(f.r+f.g+f.b == 1){
            if(f.r == 1) ar = true;
            else if(f.g == 1) ag = true;
            else if(f.b == 1) ab = true;
        }else{
            if(f.r >= 2)push(f.r-1,f.g,f.b);
            if(f.g >= 2)push(f.r,f.g-1,f.b);
            if(f.b >= 2)push(f.r,f.g,f.b-1);

            if(f.r > 0 && f.g > 0)push(f.r-1,f.g-1,f.b+1);
            if(f.r > 0 && f.b > 0)push(f.r-1,f.g+1,f.b-1);
            if(f.g > 0 && f.b > 0)push(f.r+1,f.g-1,f.b-1);
        }
    }

    if(ab) cout << "B";
    if(ag) cout << "G";
    if(ar) cout << "R";
    cout << endl;
}

#include<iostream>
#include<utility>
#include<algorithm>
#define ll long long

using namespace std;

int main ()
{
    ll n;
    cin>>n;
    string s;
    cin>>s;
    ll b_ans=0,g_ans=0,r_ans=0;
    //sort(s.begin(),s.end());
    for(ll i=0;i<s.size();i++)
    {
        if(s[i]=='B') {b_ans++;}
        if(s[i]=='R') {r_ans++;}
        if(s[i]=='G') {g_ans++;}
        //cout<<i<<endl;

    }
    //cout<<b_ans<<' '<<g_ans<<' '<<r_ans<<endl;
    if(b_ans>=1 && r_ans>=1 && g_ans>=1)
        cout<<"BGR"<<endl;
    else if((b_ans>1 && r_ans>1) ||(r_ans>1 && g_ans>1) ||(b_ans>1 && g_ans>1))
        cout<<"BGR"<<endl;

    else if(g_ans>1 && (b_ans==1 || r_ans==1))
        cout<<"BR"<<endl;
    else if(r_ans>1 && (g_ans==1 || b_ans==1))
        cout<<"BG"<<endl;
    else if(b_ans>1 &&  (r_ans==1 || g_ans==1))
        cout<<"GR"<<endl;

    else if((b_ans==1 && r_ans==1)|| g_ans==n)
        cout<<"G"<<endl;
    else if((b_ans==1 && g_ans==1)|| r_ans==n)
        cout<<"R"<<endl;
    else if((g_ans==1 && r_ans==1)|| b_ans==n)
        cout<<"B"<<endl;

    return 0;
}

// rc.cpp
//

#include <assert.h>
#include <time.h>
#include <math.h>
#include <string.h>

#include <iterator>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>

using namespace std;

#define PI 3.1415926535897932384626433832795
#define EPS 1E-11

typedef unsigned char uchar;
typedef unsigned int uint;
typedef unsigned long long uint64;
typedef long long sint64;

char d[] = "BGR";

int main(int argc, char* argv[])
{
	uint n;
	string s;
	cin >> n >> s;

	uint c[3] = { 0 };
	for (uint i = 0; i < n; ++i)
	{
		if (s[i] == 'B')
			++c[0];
		else if (s[i] == 'G')
			++c[1];
		else
			++c[2];
	}

	if (c[0] && c[1] == 0 && c[2] == 0 ||
		c[0] == 0 && c[1] && c[2] == 0 ||
		c[0] == 0 && c[1] == 0 && c[2])
	{
		uint k = c[0] ? 0 : c[1] ? 1 : 2;
		cout << d[k] << endl;
	}
	else
	{
		if ((c[0] && c[1] && c[2] == 0 ||
			c[0] && c[1] == 0 && c[2] ||
			c[0] == 0 && c[1] && c[2]) && n == 3)
		{
			uint k = 0, l = 0;
			if (c[0] == 1)
				k = 0;
			else if (c[1] == 1)
				k = 1;
			else
				k = 2;

			if (c[0] == 2)
				l = k == 1 ? 2 : 1;
			else if (c[1] == 2)
				l = k == 0 ? 2 : 0;
			else
				l = k == 0 ? 1 : 0;

			if (l < k)
				swap(l, k);

			cout << d[k] << d[l] << endl;
		}
		else
		{
			if (n == 2)
			{
				uint k = 0;
				if (c[0] == 0)
					k = 0;
				else if (c[1] == 0)
					k = 1;
				else
					k = 2;

				cout << d[k] << endl;
			}
			else
				cout << d << endl;
		}
	}

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define eb emplace_back
#define vi vector<int>
#define vll vector<ll>
#define REP(i,a,b) for(ll i=a; i<b;i++)
#define fill(arr, i) memset(arr, i, arr.size()*sizeof(arr[0]))
#define coutv(arr) cout<<#arr<<": " ; for(auto i: arr) cout<<(i==INT_MAX?'I':i)<<" "; cout<<"\n";
#define cout(n) cout<<fixed<<setprecision(n)
#define name(x) cout<<#x<<": "<<x<<"\n";
#define ms(a,x) memset(a, x, sizeof(a))
#define gcd(a,b) __gcd(a,b)
// freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);

int n;
string str;
string rgb = "RGB";
string ans;

int main(){
	cin>>n>>str;
	map<char, int> cnt;
	for(char ch: str){
		cnt[ch]++;
	}
	if(cnt.size() == 3){
		ans = rgb;
	}
	else if(cnt.size()==2){
		bool one = (cnt['R']==1 || cnt['G']==1 || cnt['B']==1);
		bool bothone = ((cnt['R']==1 )^( cnt['G']==1) ^ (cnt['B']==1)) == 0;
		if(one && bothone){
			for(char ch: rgb){
				if(cnt[ch] == 0){
					ans+=ch;
				}
			}
		}
		else if(one){
			for(char ch: rgb){
				if(cnt[ch] == 0){
					ans+=ch;
				}
				if(cnt[ch] == 1){
					ans+=ch;
				}
			}

		}
	}
	else {
		ans+=str[0];
	}
	sort(ans.begin(), ans.end());
	cout<<ans;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int INF = 0x3f3f3f3f , MOD = 1e9+7 , maxn = 123456;
struct node
{
    char t;
    int n;
};
node s[5],ss[5];
bool cmp(node s1,node s2)
{
    return s1.n<s2.n;
}
void cp(){for (int i = 1;i <= 3;i++) ss[i]=s[i];}
void mysort(node s[]){sort(s+1,s+4,cmp);}
int main()
{
    int n;
    char temp;
    cin>>n;s[1].t='R';s[2].t='G';s[3].t='B';
    for (int i = 1;i <= n;i++)
    {
        cin>>temp;
        if (temp=='R')s[1].n++;
        else if (temp=='G')s[2].n++;
        else if (temp=='B')s[3].n++;
    }
    mysort(s);char chu[5];int cc=0;
    if (s[2].n==0){cout<<s[3].t;}
    else if (s[1].n==0&&s[2].n!=0)
    {
        if (s[2].n==s[3].n)
        {
            cout<<s[1].t;
        }else
        {
            if (s[1].t<s[2].t)
               cout<<s[1].t<<s[2].t;
            else cout<<s[2].t<<s[1].t;
        }
    }
    else if (s[1].n!=0&&s[2].n!=0&&s[3].n!=0)
        cout<<"BGR";
    cout<<endl;
    return 0;
}

#include <bits/stdc++.h>

#define inf 0x3f3f3f3f

#define INF 0x3f3f3f3f3f3f3f3fLL

#define mod 1000000007

#define pb push_back

#define mp make_pair

#define sq(x) ((x)*(x))

#define x first

#define y second

#define eps 1e-8

#define bpt(x) (__builtin_popcount(x))

#define bptl(x) (__builtin_popcountll(x))

#define bit(x, y) (((x)>>(y))&1)

#define bclz(x) (__builtin_clz(x))

#define bclzl(x) (__builtin_clzll(x))

#define bctz(x) (__builtin_ctz(x))

#define bctzl(x) (__builtin_ctzll(x))

#define PQ priority_queue<pii, vector<pii>, greater<pii> >

using namespace std;

typedef long long INT;

typedef vector<int> VI;

typedef pair<int, int> pii;

typedef pair<pii, int> pi3;

typedef double DO;

template<typename T, typename U> inline void smin(T &a, U b) {if (a>b) a=b;}

template<typename T, typename U> inline void smax(T &a, U b) {if (a<b) a=b;}

inline void gn(long long&x){

	int sg=1;char c;while(((c=getchar())<'0'||c>'9')&&c!='-');c=='-'?(sg=-1,x=0):(x=c-'0');

	while((c=getchar())>='0'&&c<='9')x=x*10+c-'0';x*=sg;

}

inline void gn(int&x){long long t;gn(t);x=t;}

inline void gn(unsigned long long&x){long long t;gn(t);x=t;}

inline void gn(double&x){double t;scanf("%lf",&t);x=t;}

inline void gn(long double&x){double t;scanf("%lf",&t);x=t;}

int power(int a, int b, int m, int ans=1) {

	for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m;

	return ans;

}

char s[1000010];

char A, B, C;

int main(){

	int n,a=0, b=0, c=0;

	scanf("%d%s", &n, s);

	A='B', B='G', C='R';

	for(int i=0; i<n; i++){

		if(s[i]==A) a++;

		if(s[i]==B) b++;

		if(s[i]==C) c++;

	}

	if (a>b) swap(a, b), swap(A, B);

	if (a>c) swap(a, c), swap(A, C);

	if (b>c) swap(b, c), swap(B, C);

	if (a || b>1) {puts("BGR");return 0;}

	if (b==0) {putchar(C);return 0;}

	if (c==1) {putchar(A);return 0;}

	puts("BGR");

	return 0;

}

//Classic
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pi pair<int,int>
#define vp vector<pi>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define For(i,a,b) for(ll i=a;i<b;i++)
#define endl "\n"
#define debug(x) cout<<"AA Baju Smit------> "<<#x<<" -> "<<x<<endl
#define all(x) x.begin(),x.end()
#define mint map<int,int>
#define mod 1000000007
#define ciN cin
#define X INT_MAX
#define N INT_MIN
////////////////////////////////////////////////////////////////
int cap(int r, int b, int g) {
	if (r < 0 || b < 0 || g < 0)return 0;

}
void jabru() {
	int n; ciN >> n;
	string s; cin >> s;
	int r = 0, g = 0, b = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'R')r++;
		else if (s[i] == 'G')g++;
		else
			b++;
	}
	if (r == 0 && g == 0) {
		cout << "B" << endl;
	}
	else if (r == 0 && b == 0) {
		cout << "G" << endl;
	}
	else if (b == 0 && g == 0) {
		cout << "R" << endl;
	}
	else {
		string ans = "";
		if (r == b == g) {
			cout << "BGR" << endl; return;
		}
		if (b == 0) {
			ans += 'B';
		}
		else if (b != 0) {
			if (r > 1 || g > 1) {
				ans += 'B';
			}
		}
		if (g == 0) {
			ans += 'G';
		}
		else {
			if (b > 1 || r > 1) {
				ans += 'G';
			}
		}
		if (r == 0) {
			ans += 'R';
		}
		else {
			if (b > 1 || g > 1) {
				ans += 'R';
			}
		}
		cout << ans << endl;
	}

}

////////////////////////////////////////////////////////////////

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t;
	//cin >> t;
	t = 1;
	while (t--)
		jabru();

	return 0;
}

///////////////////////////////////////////////////////////////////////////////////////////
//Kai baju bhai???

#include <bits/stdc++.h>
#define ll          long long int
#define ull         unsigned long long int
#define pb          emplace_back
#define mp          make_pair
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define all(v)      (v).begin(),(v).end()
#define F           first
#define S           second
#define MAX  INT_MAX
#define MIN INT_MIN
#define sz(x)       int(x.size())
#define MOD         1000000007
#define endl        '\n'
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define SIZE        26
#define watch(x)    cout << (#x) << " is " << (x) << endl
using namespace std;
ll dp[1000007]={0};
int main()
  {
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);

      ll n;
      cin>>n;
      char arr[n];
      char arr1[n];
      char arr2[n];
      set<char> s;
      cin>>arr;
      rep(i,0,n)
       {
       arr1[i]=arr[i];
       arr2[i]=arr[i];
        }
      for(ll i=n-1;i>0;i--)
        {
          if((arr[i]=='B' && arr[i-1]=='G') || (arr[i-1]=='B' && arr[i]=='G'))
            arr[i-1]='R';
          else if((arr[i]=='R' && arr[i-1]=='G') || (arr[i-1]=='R' && arr[i]=='G'))
            arr[i-1]='B';
          else if((arr[i]=='R' && arr[i-1]=='B') || (arr[i-1]=='R' && arr[i]=='B'))
            arr[i-1]='G';
        }

      //cout<<arr[0]<<endl;
      s.insert(arr[0]);
      sort(arr1,arr1+n);
      for(ll i=n-1;i>0;i--)
        {
          if((arr1[i]=='B' && arr1[i-1]=='G') || (arr1[i-1]=='B' && arr1[i]=='G'))
            arr1[i-1]='R';
          else if((arr1[i]=='R' && arr1[i-1]=='G') || (arr1[i-1]=='R' && arr1[i]=='G'))
            arr1[i-1]='B';
          else if((arr1[i]=='R' && arr1[i-1]=='B') || (arr1[i-1]=='R' && arr1[i]=='B'))
            arr1[i-1]='G';
        }
        //cout<<arr1[0]<<endl;
        s.insert(arr1[0]);
        sort(arr2,arr2+n,greater<char>());
        for(ll i=n-1;i>0;i--)
          {
            if((arr2[i]=='B' && arr2[i-1]=='G') || (arr2[i-1]=='B' && arr2[i]=='G'))
              arr2[i-1]='R';
            else if((arr2[i]=='R' && arr2[i-1]=='G') || (arr2[i-1]=='R' && arr2[i]=='G'))
              arr2[i-1]='B';
            else if((arr2[i]=='R' && arr2[i-1]=='B') || (arr2[i-1]=='R' && arr2[i]=='B'))
              arr2[i-1]='G';
          }
        //cout<<arr2[0]<<endl;
        s.insert(arr2[0]);
        for(auto i=s.begin();i!=s.end();i++)
          {
            cout<<*i;
          }
        cout<<endl;

      return 0;

  }

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <string.h>
#include <fstream>

using namespace std;

const int INF = 1000000007;

int n, k;

string s;
int b, g, r;
char col;

int main() {
	//freopen("inp.txt", "rt", stdin);
	//freopen("out.txt", "wt", stdout);

	cin >> n;

	for (int i = 0; i < n; i++)
	{
		cin >> col;
		if (col == 'B') b++;
		if (col == 'G') g++;
		if (col == 'R') r++;
	}

	if (b && g && r)
	{
		cout << "BRG\n";
		return 0;
	}

	if (b > 1 && g)
	{
		cout << "RG\n";
		return 0;
	}

	if (r > 1 && g)
	{
		cout << "BG\n";
		return 0;
	}

	if (g > 1 && b)
	{
		cout << "BR\n";
		return 0;
	}

	if (r && g)
	{
		cout << "B\n";
		return 0;
	}

	if (b && g)
	{
		cout << "R\n";
		return 0;
	}

	if (b && r)
	{
		cout << "G\n";
		return 0;
	}

	if (!b)
	{
		cout << "B\n";
		return 0;
	}

	if (!r)
	{
		cout << "R\n";
		return 0;
	}

	if (!g)
	{
		cout << "G\n";
		return 0;
	}

	return 0;
};

#include <iostream>
#include <map>
using namespace std;

int main(){
	int tam;
	cin >> tam;
	string s;
	cin >> s;
	map<char, int> cont;
	for(int i=0; i<tam; i++) cont[s[i]]++;
	if(cont['R'] && cont['G'] && cont['B']){
		cout << "BGR" << endl;
		return 0;
	}
	if(cont['R'] && cont['G']){
		if(cont['R']-1 && cont['G']-1){
			cout << "BGR" << endl;
			return 0;
		}
		if(cont['R']-1){
			cout << "BR" << endl;
			return 0;
		}
		if(cont['G']-1){
			cout << "BG" << endl;
			return 0;
		}
		if(!(cont['R']-1) && !(cont['G']-1)){
			cout << "B" << endl;
		}
	}
	if(cont['B'] && cont['G']){
		if(cont['B']-1 && cont['G']-1){
			cout << "BGR" << endl;
			return 0;
		}
		if(cont['B']-1){
			cout << "BR" << endl;
			return 0;
		}
		if(cont['G']-1){
			cout << "GR" << endl;
			return 0;
		}
		if(!(cont['B']-1) && !(cont['G']-1)){
			cout << "R" << endl;
		}
	}
	if(cont['R'] && cont['B']){
		if(cont['R']-1 && cont['B']-1){
			cout << "BGR" << endl;
			return 0;
		}
		if(cont['R']-1){
			cout << "GR" << endl;
			return 0;
		}
		if(cont['B']-1){
			cout << "BG" << endl;
			return 0;
		}
		if(!(cont['R']-1) && !(cont['B']-1)){
			cout << "G" << endl;
		}
	}
	if(cont['R']){
		cout << "R" << endl;
		return 0;
	}
	if(cont['G']){
		cout << "G" << endl;
		return 0;
	}
	if(cont['B']){
		cout << "B" << endl;
		return 0;
	}
	return 0;
}

#include <iostream>
/*每天在CF上刷B,C，D题各一道*/
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <string>
#define INF 0x3f3f3f3f
#define eps 1e-8
#define SIZE (200+10)
#define Ri(a) scanf("%d", &a)
#define Rl(a) scanf("%I64d", &a)
#define Rf(a) scanf("%lf", &a)
#define Rs(a) scanf("%s", a)
#define Pi(a) printf("%d\n", (a))
#define Pf(a) printf("%lf\n", (a))
#define Pl(a) printf("%I64d\n", (a))
#define Ps(a) printf("%s\n", (a))
#define CLR(a, b) memset(a, (b), sizeof(a))
#define INT_MAX 2147483647
#define LL_MAX 9223372036854775807
#define ll __int64
#define lson l, mid, rt<<1
#define rson mid+1, r, rt<<1|1
#define PI acos(-1.0)
const long long MOD = 1000000007;
using namespace std;
int r_count = 0,b_count = 0,g_count = 0;
int main()
{
    int n;
    Ri(n);
    getchar();
    int i;
    for(i = 0; i < n; i++)
    {
        char co;
        scanf("%c",&co);
        if(co == 'B')
            b_count++;
        if(co == 'R')
            r_count++;
        if(co == 'G')
            g_count++;
    }

    //判断B
    if(b_count>=0&&r_count>0&&g_count > 0)
        printf("B");
    else if( b_count > 0 && max(r_count,g_count) > 1 && min(r_count,g_count) == 0)
        printf("B");
    else if( r_count == 0&&g_count == 0 )
        printf("B");

    //判断R
    if(r_count>=0&&b_count>0&&g_count > 0)
        printf("R");
    else if( r_count > 0 && max(b_count,g_count) > 1 && min(b_count,g_count) == 0)
        printf("R");
    else if( b_count == 0&&g_count == 0 )
        printf("R");
    //判断G
    if(g_count>=0&&r_count>0&&b_count > 0)
        printf("G");
    else if( g_count > 0 && max(r_count,b_count) > 1 && min(r_count,b_count) == 0)
        printf("G");
    else if( r_count == 0&&b_count == 0 )
        printf("G");
    printf("\n");
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int N = 500;

int n, c[3], cc[3];
string s, ans;

void solve(int a, int b, int c){
    if (a == 0 && b == 0 && c != 0){
        if (ans.find('B') == string::npos) ans +='B';
        return ;
    }
    if (a == 0 && b != 0 && c == 0){
        if (ans.find('G') == string::npos) ans +='G';
        return ;
    }
    if (a != 0 && b == 0 && c == 0){
        if (ans.find('R') == string::npos) ans +='R';
        return ;
    }
    if (a != 0 && b != 0) solve(a - 1, b - 1, c + 1);
    if (a != 0 && c != 0) solve(a - 1, b + 1, c - 1);
    if (b != 0 && c != 0) solve(a + 1, b - 1, c - 1);
    if (a >= 2) solve(a - 1, b , c);
    if (b >= 2) solve(a, b - 1, c);
    if (c >= 2) solve(a, b, c - 1);
}

int main()
{
    cin >> n >> s;
    n = s.length();
    for (int i = 0; i < n; ++i){
        if (s[i] == 'R') c[0]++;
        if (s[i] == 'G') c[1]++;
        if (s[i] == 'B') c[2]++;
    }

    for (int i = 0; i < 3; ++i){
        if (c[i] == 0) continue;
        if (c[i] % 2 == 0) c[i] = 2;
        else c[i] = 1;
    }

    solve(c[0], c[1], c[2]);

    sort(ans.begin(), ans.end());
    cout << ans << endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios :: sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    //freopen ("CF.inp", "r", stdin);
    //freopen ("CF.out", "w", stdout);

    int numR = 0, numG = 0, numB = 0;
    int n; string st;
    cin >> n;
    cin >> st;
    st = ' ' + st;
    for (int i = 1; i <= n; i++) {
        if (st[i] == 'R') numR++;
        if (st[i] == 'G') numG++;
        if (st[i] == 'B') numB++;
    }

    if (numB == n || numG == n || numR == n) {
        if (numR == n) cout << 'R';
        if (numG == n) cout << 'G';
        if (numB == n) cout << 'B';
        return 0;
    }
    if (numR > 0 && numG > 0 && numB > 0) {
        cout << "BGR";
        return 0;
    }
    if (numR == 0) {
        if (n == 2) cout << 'R';
        if (n == 2) return 0;
        if (numG > 1 && numB > 1) cout << "BG";
        else cout << (numG == 1 ? 'G' : 'B');
        cout << 'R';
        return 0;
    }

    if (numB == 0) {
        cout << 'B';
        if (n == 2) return 0;
        if (numG > 1 && numR > 1) cout << "GR";
        else cout << (numG == 1 ? 'G' : 'R');
        return 0;
    }

    //cerr << numG;

    if (numG == 0) {
        if (n == 2) cout << 'G';
        if (n == 2) return 0;
        if (numB > 1 && numR > 1) cout << "BGR";
        if (numB == 1) cout << "BG";
        else cout << "GR";
        return 0;
    }

    return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

int main()
{
    string s;
    int r=0, g=0, b=0, n;
    cin >> n >> s;
    for(int i=0; i < n; ++i)
    {
        if(s[i] == 'R')
            r++;
        if(s[i] == 'G')
            g++;
        if(s[i] == 'B')
            b++;
    }
    if(r && g && b)
    {
        cout << "BGR" << endl;
    }
    else if(!r && !g)
    {
        cout << "B" << endl;
    }
    else if(!r && !b)
    {
        cout << "G" << endl;
    }
    else if(!g && !b)
    {
        cout << "R" << endl;
    }
    else if(!g)
    {
        if(b > r)
            cout << "GR" << endl;
        if(b == r)
            cout << "G" << endl;
        if(b < r)
            cout << "BG" << endl;
    }
    else if(!b)
    {
        if(g > r)
            cout << "BR" << endl;
        if(g == r)
            cout << "B" << endl;
        if(g < r)
            cout << "BG" << endl;
    }
    else if(!r)
    {
        if(b > g)
            cout << "GR" << endl;
        if(b == g)
            cout << "R" << endl;
        if(b < g)
            cout << "BR" << endl;
    }

    return 0;
}

#include <bits/stdc++.h>
#include<iostream>
#include<queue>
using namespace std;
int main(){
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int n;
	cin>>n;
	string s;
	cin>>s;
	int r=count(s.begin(), s.end(),'R');
	int b=count(s.begin(), s.end(),'B');
	int g=count(s.begin(), s.end(),'G');
	if(r==0){
		if(b==0)
			cout<<"G";
		else if(g==0)
			cout<<"B";
		else if(b==1&&g==1)
			cout<<"R";
		else if(b==1&&g>=2)
			cout<<"BR";
		else if(g==1&&b>=2)
			cout<<"GR";
		else if(b>=2&&g>=2)
			cout<<"RBG";
	}
	else if(b==0){
		if(r==0)
			cout<<"G";
		else if(g==0)
			cout<<"R";
		else if(r==1&&g==1)
			cout<<"B";
		else if(r==1&&g>=2)
			cout<<"RB";
		else if(g==1&&r>=2)
			cout<<"GB";
		else if(r>=2&&g>=2)
			cout<<"RGB";
	}
	else if(g==0){
		if(r==0)
			cout<<"B";
		else if(b==0)
			cout<<"R";
		else if(r==1&&b==1)
			cout<<"G";
		else if(r==1&&b>=2)
			cout<<"RG";
		else if(b==1&&r>=2)
			cout<<"BG";
		else if(r>=2&&b>=2)
			cout<<"RBG";
	}
	else
		cout<<"RBG";

}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

ll fact(int n){
    ll dp[n+1];
    dp[0]=1;dp[1]=1;
    for(int i=2;i<=n;i++){
        dp[i]=dp[i-1]*i;
    }
    return dp[n];
}

int main(){
    int n;cin>>n;
    string s;cin>>s;
    set<char> st;
    int G=0,B=0,R=0;
    for(int i=0;i<s.length();i++){
        st.insert(s[i]);
        if(s[i]=='G')G++;
        if(s[i]=='B')B++;
        if(s[i]=='R')R++;
    }
    int size=st.size();
    if(size==1){
        cout<<*(st.begin())<<endl;
        return 0;
    }
    if(G>0 && B>0 && R>0){
        cout<<"GBR"<<endl;
        return 0;
    }
   if(n%2==0){
       if(G==0 && R==B)cout<<'G'<<endl;
       else if(B==0 && G==R)cout<<'B'<<endl;
       else if(R==0 && G==B)cout<<'R'<<endl;
   }
   else if(n%2==1){
       if(G==0)
       {
           cout<<'G';
           if(R%2==1)cout<<'R'<<endl;
           else cout<<'B'<<endl;
       }
       else if(B==0)
       {
           cout<<'B';
           if(R%2==1)cout<<'R'<<endl;
           else cout<<'G'<<endl;
       }
       else if(R==0)
       {
           cout<<'R';
           if(G%2==1)cout<<'G'<<endl;
           else cout<<'B'<<endl;
       }

   }
    return 0;
}

// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("unroll-loops")

#include <bits/stdc++.h>
using namespace std;
# define fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl "\n"
#define all(v) v.begin(),v.end()
#define mod1 1000000009
#define mod 1000000007
#define Mod 998244353
#define ha "YES"
#define na "NO"
#define len(s) int(s.size())
#define pb push_back
#define eb emplace_back
#define rev(s) reverse(all(s))
typedef unsigned long long ull;
typedef long long ll;

void IO()
{
#ifndef ONLINE_JUDGE
	freopen("pracin.txt", "r", stdin);
	freopen("pracout.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
#endif
	fast;
}
// vector<bool> used;
// vector<vector<int>> adj;
// vector<int> dir[200005];
// vector<int> a, b;
//bipartite graph or not using bfs

// void bfs(int i)
// {
// 	queue<int> q;
// 	q.push(i);
// 	used[i] = 1;
// 	a.push_back(i);
// 	while (!q.empty())
// 	{	i = q.front();
// 		q.pop();
// 		for (auto vertex : adj[i])
// 		{
// 			if (used[vertex] == -1)
// 			{
// 				used[vertex] = used[i] ^ 1;
// 				if (used[vertex] == 1) a.push_back(vertex);
// 				else b.push_back(vertex);
// 				q.push(vertex);
// 			}
// 			if (used[vertex] == used[i]) {
// 				cout << -1;
// 				exit(0);
// 			}

// 		}

// 	}
// }

// fast exponention (logn)
ll binary_exponention(ll a, ll b) {
	if (b == 0)
		return 1;
	ll res = binary_exponention(a, b / 2);
	if (b % 2)
		return res * res * a % Mod;

	return res * res % Mod;

}

// Chal WA likh ab

inline void read(ll a[], int n, int which = 0)
{
	if (which)
		for (int i = 1; i <= n; i++) cin >> a[i];
	else for (int i = 0; i < n; i++) cin >> a[i];
}
inline void write(ll a[], int n, int which = 0)
{
	if (which == 0)
		for (int i = 0; i < n; i++) cout << a[i] << " ";
	else for (int i = 1; i <= n; i++) cout << a[i] << " ";
}
int dir8i[8] = { -1, -1, 0, 1, 1, 1, 0, -1};

int dir4i[4] = { -1, 0, 1, 0};
int dir4j[4] = {0, -1, 0, 1};

// To Do

// 10580 - Ransom Note
// matrix matcher uva
// extend the palindrome

void  solve()
{

	int n; cin >> n;
	string s; cin >> s;
	set<char> se;
	map<char, int> m;
	for (int i = 0; i < n; i++) se.insert(s[i]), m[s[i]]++;
	sort(all(s));
	if (len(s) == 1)
	{
		cout << s[0];
		return;
	}
	if (len(s) == 2)
	{

		if (s[0] == s[1])
			cout << s[0];
		else {
			if (s[0] == 'B' && s[1] == 'G') cout << 'R';
			else  if (s[0] == 'B' && s[1] == 'R') cout << 'G';
			else cout << "B";
		}
		return;
	}
	if (len(se) == 1)
	{
		cout << s[0];
	}
	else if (len(se) == 3)
	{
		cout << "BGR";
	}
	else {
		if ( (m['R'] > 1 && m['G'] > 1 ) || (m['R'] > 1 && m['B'] > 1) || (m['G'] > 1 && m['B'] > 1))
		{
			cout << "BGR";
		}
		else {
			if (m['R'] && m['G'])
			{
				if (m['R'] > 1 && m['G'] > 1)
					cout << "BGR";
				else {
					if (m['R'] > 1)
						cout << "BG";
					else cout << "BR";
				}
			}
			else if (m['R'] && m['B'])
			{
				if (m['R'] > 1 || m['B'] > 1)
					cout << "BGR";
				else {
					if (m['R'] > 1)
						cout << "BG";
					else cout << "GR";
				}
			}
			else
			{
				if (m['B'] > 1 && m['G'] > 1)
					cout << "BGR";
				else {
					if (m['B'] > 1)
						cout << "GR";
					else cout << "BR";
				}
			}

		}
	}
}

int  main()
{
	IO();

	// int t; cin >> t; while (t--)
	solve();

#ifndef ONLINE_JUDGE
	cerr  << 1.0 * clock() / CLOCKS_PER_SEC << "s\n";
#endif

}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define mp make_pair
#define fst first
#define snd second
#define pb push_back
#define pop pop_back

#define rep(i, a, b) for(int i = a; i < b; i++)

ll min (ll a, ll b){
	if (a<b){return a;} else {return b;}
}

ll max (ll a, ll b){
	if (a>b){return a;} else {return b;}
}

double mind(double a, double b){
	if (a<b){return a;} else {return b;}
}

double maxd(double a, double b){
	if (a>b){return a;} else {return b;}
}

double lognd(double x, double base){
	return (log(x)/log(base));
}

long long int mod (long long int x, long long int m){
	x = x%m;
	if (x < 0){x += m;}
	return x;
}

bool ig(double a, double b){
	return (abs(a-b) < 1e-9);
}

int main(){

	int n;
	cin >> n;
	string s;
	cin >> s;
	int r = 0,g = 0,b = 0;
	rep(i,0,n){
		if (s[i] == 'R'){
			r++;
		} else if (s[i] == 'G'){
			g++;
		} else {
			b++;
		}
	}

	string res;
	if (r>0 && b> 0 && g>0){
		res = "BGR";
	} else if ((r >=2 && g>=2) || (r>=2 && b>=2) || (g>=2 && r>=2)){
		res = "BGR";
	} else if ((r ==1 && g==1) || (r==1 && b==1) || (g==1 && b==1)){
		if (r ==1 && g==1){
			res = "B";
		} else if (r==1 && b==1){
			res = "G";
		} else {
			res = "R";
		}
	} else if ((r >=1 && g==0 && b==0) || (r ==0 && g>=1 && b==0) || (r ==0 && g==0 && b>=1)){
		if (r >=1 && g==0 && b==0){
			res ="R";
		} else if (r ==0 && g>=1 && b==0){
			res = "G";
		} else {
			res = "B";
		}
	} else{
		if (r>=2){
			res="BG";
		} else if (g>=2){
			res ="BR";
		} else {
			res = "GR";
		}
	}

	cout << res << endl;

	return 0;
}

#include <iostream>

#include <algorithm>

#include <cstring>

#include <string>

using namespace std;

char a[250], s;

int n, i, r, g, b, c1 = 0, c2 = 0, c3 = 0;

void search(int r, int g, int b){

	if (b + g + r == 1){

		if (b == 1) c1 = 1;

		if (g == 1) c2 = 1;

		if (r == 1) c3 = 1;

		return ;

	}

	if (b > 1) search(r, g, b - 1);

	if (g > 1) search(r, g - 1, b);

	if (r > 1) search(r - 1, g, b);

	if (b && g) search(r + 1, g - 1, b - 1);

	if (b && r) search(r - 1, g + 1, b - 1);

	if (g && r) search(r - 1, g - 1, b + 1);

}

int main() {

	cin>>n;

	r = 0; g = 0; b = 0;

	for(i = 0; i < n; i ++ ) {

		cin >>a[i];

		if (a[i] == 'R') r++;

		else if (a[i] == 'G') g++;

		else if (a[i] == 'B') b++;

	}

	if (r == 0 && g == 0 && b == 0) return 0;

	else search(r, g, b);

	if (c1 == 1) cout<<"R";

	if (c2 == 1) cout<<"G";

	if (c3 == 1) cout<<"B";

	cout<<endl;

	return 0;

}

//  Mafi, KUET 2K11

#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef unsigned long long ull;

#define sc1(n) scanf("%d",&n)
#define sc2(a,b) scanf("%d %d",&a,&b)
#define sc3(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define sl1(n) scanf("%lld",&n)
#define sl2(a,b) scanf("%lld %lld",&a,&b)
#define sl3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)
#define mem(v,val) memset(v,val,sizeof v)
#define sz(v) v.size()
#define REVERSE(v) reverse(v.begin(),v.end())
#define SORT(v) sort(v.begin(),v.end())
#define pb push_back
#define ff first
#define ss second
#define MP make_pair
#define pp pair<int,int>
#define pp1 pair<int,pair<int,int> >
#define pp2 pair<pair<int,int>,int >

#define rep(i,n) for(i=1;i<=n;i++)
#define Rep(i,n) for(i=0;i<n;i++)
#define For(i,a,b) for(i=a;i<=b;i++)

#define INF INT_MAX
#define MAXN 100006
#define modu 1000003
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)

#define read() freopen("input.txt","r",stdin);
#define write() freopen("output.txt","w",stdout);

const double pi=acos(-1.0);

//int row[]={1,0,-1,0};int col[]={0,1,0,-1}; //4 Direction
//int row[]={1,1,0,-1,-1,-1,0,1};int col[]={0,1,1,1,0,-1,-1,-1};//8 direction
//int row[]={2,1,-1,-2,-2,-1,1,2};int col[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction

ll leap(ll x)
{
    if((x%4==0&&x%100!=0)||x%400==0) return 1;
    return 0;
}

ll nCr(ll n, ll r)
{
    if(r==0) return 1;
    else return nCr(n-1,r-1)*n/r;
}

ll mod(ll N,ll M)//N%M
{
    ll temp = N/M;
    N-=temp*M;
    return N;
}

ll bigmod(ll N,ll M,ll MOD) //(N^M)%MOD
{
    if(M==0) return 1;
    if((M/2)*2==M)
    {
        ll ret = bigmod(N,M/2,MOD);
        return ((ret%MOD)*(ret%MOD))%MOD;
    }
    else return ((N%MOD)*bigmod(N,M-1,MOD)%MOD)%MOD;
}

ll modinverse(ll a,ll m)  //a*x=1(mod m)
{
    return bigmod(a,m-2,m);
}

struct Euclid
{
    ll x,y,d;
    Euclid() {};
    Euclid(ll xx,ll yy,ll dd)
    {
        x = xx, y = yy, d = dd;
    }
};

Euclid Extended_gcd(ll a, ll b)// input a,b Output x,y,d;ax+by = d,d=gcd(a,b)
{
    if(!b)
        return Euclid(1,0,a);
    Euclid e = Extended_gcd(b,a%b);
    return Euclid(e.y,e.x-a/b*e.y,e.d);
}

#define count_bit(x)    __builtin_popcountll(x) //number of 1 in binary of x; __builtin_popcount=int,__builtin_popcountl=long int,__builtin_popcountll=long long int
ll Set(ll N,ll pos)
{
    return N|(1LL<<pos);
}
ll reset(ll N,ll pos)
{
    return N&~(1LL<<pos);
}
ll check(ll N,ll pos)
{
    return (N&(1LL<<pos));
}

string s,bal;
int n,r,g,b;

int solve(char ch,int x,int y,int z)
{
    //res+=ch;
    //cout<<ch<<" "<<x<<" "<<y<<" "<<z<<endl;
    if(x<0||y<0||z<0)
        return 0;

    if(x+y+z<2)
    {
        bal+=ch;
        return 0;
    }

    if(x>=2)
    {
       // res+='R';
        solve('R',x-1,y,z);
    }
    if(y>=2)
    {
        //res+='G';
        solve('G',x,y-1,z);
    }
    if(z>=2)
    {
        //res+='B';
        solve('B',x,y,z-1);
    }

    if(x>=1&&y>=1)
    {
        //res+='B';
        solve('B',x-1,y-1,z+1);
    }

    if(x>=1&&z>=1)
    {
       // res+='G';
        solve('G',x-1,y+1,z-1);
    }

    if(y>=1&&z>=1)
    {
        //res+='R';
        solve('R',x+1,y-1,z-1);
    }
}

int main()
{
    ios_base::sync_with_stdio(0);
    r=g=b=0;
    cin>>n;
    cin>>s;
    //res="";
    bal="";
    for(int i=0;s[i];i++)
    {
        if(s[i]=='R')
            r++;
        else if(s[i]=='G')
            g++;
        else
            b++;
    }

    solve('a',r,g,b);

    set<char>st;
    set<char>::iterator it;

    int len = bal.size();

    //cout<<res<<endl;

    int cnt=0;

    for(int i=len-1;i>=0;i--)
    {
        cnt++;
        st.insert(bal[i]);
        if(cnt==3)
            break;
    }

    for(it=st.begin();it!=st.end();it++)
        cout<<(*it);
    cout<<endl;

    return 0;
}

#include <iostream>
#include <stdio.h>
#include <conio.h>
#include <vector>
#include <string>
using namespace std;
int main()
{
	int n;
	string s;
	cin >> n;
	cin >> s;

	int r=0,g=0,b=0;
	bool R=false,G=false,B=false;
	for (int i = 0; i < n; i++)
	{
		if (s[i]=='R') r++;
		if (s[i]=='G') g++;
		if (s[i]=='B') b++;

	}

	if (r+b==0) G=true;
	if (r+g==0) B=true;
	if (b+g==0) R=true;

	if (r>2) r=2;
	if (g>2) g=2;
	if (b>2) b=2;

	if (r==1 && b ==1 && g==0) G=true;
	if (g==1 && r ==1 && b==0) B=true;
	if (b==1 && g ==1 && r==0) R=true;

		if (b==2 && g==0 && r==1) { R=true;  G=true;}
		if (r==2 && g==0 && b==1) { B=true;  G=true;}
		if (g==2 && b==0 && r==1) { R=true;  B=true;}
		if (b==2 && r==0 && g==1) { R=true;  G=true;}
		if (r==2 && b==0 && g==1) { B=true;  G=true;}
		if (g==2 && r==0 && b==1) { R=true;  B=true;}

		if (g+r==4 && b==0) { R=true; B=true; G=true;}
		if (b+r==4 && g==0) { R=true; B=true; G=true;}
		if (g+b==4 && r==0) { R=true; B=true; G=true;}

		if (g+r+b==4 && r>0 && g>0 && b>0) { R=true; B=true; G=true;}
		if (g+r+b==6 ) { R=true; B=true; G=true;}
		if (g+r+b==3 && r>0 && g>0 && b>0) { R=true; B=true; G=true;}

		if (B==true ) cout << 'B';
		if (G==true ) cout << 'G';
		if (R==true ) cout << 'R';

	//system("pause");

	//GGRR  B,
}

//coded by dsingh_24
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pll         pair<long long,long long>
#define vll          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (long long)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{
	ios
    ll n,i,j,r=0,b=0,g=0;
    cin>>n;
    string s;
    cin>>s;
    for(i=0;i<n;i++)
    {
    	if(s[i]=='R')r++;
    	if(s[i]=='B')b++;
    	if(s[i]=='G')g++;
	}
	if(r==b&&r==g)cout<<"BGR";
	if(r==b&&r==1)cout<<"G";else
	if(g==b&&g==1)cout<<"R";else
	if(r==g&&r==1)cout<<"B";else
	if(r==b||g==b||g==b)cout<<"BGR";else
	if(r>g&&r>b)cout<<"BG";else
	if(b>g&&b>r)cout<<"GR";else
	if(g>r&&g>b)cout<<"BR";
	return 0;
}

//Smile for the future :)
#include <bits/stdc++.h>
#define foreach(i,x) for(type(x)i=x.begin();i!=x.end();i++)
#define FOR(ii,aa,bb) for(int ii=aa;ii<=bb;ii++)
#define ROF(ii,aa,bb) for(int ii=aa;ii>=bb;ii--)
#define st first
#define nd second
#define mp make_pair
#define y1 asdasdasdasd
#define pb push_back
#define type(x) __typeof(x.begin())
using namespace std;
typedef pair < int ,int > pii;

int n,r,g,b;
string str;

bool f(int a,int b, int c){
	if(!a and !b) return true;
	if(a and b) return true;
	c=max(b,c);
	if(!a) return false;
	if(c>1) return true;

}

main(){
	cin>>n>>str;

	FOR(i,0,n-1){
		if(str[i]=='R') r++;
		if(str[i]=='G') g++;
		if(str[i]=='B') b++;

	}

		if(f(b,g,r)) printf("B");
		if(f(g,r,b)) printf("G");
		if(f(r,g,b)) printf("R");
		cout<<endl;
	}

#define _CRT_SECURE_NO_WARNINGS
#include <fstream>
#include <map>
#include <iostream>
#include <utility>
#include <set>
#include <algorithm>
#include <bitset>
#include <queue>
#include <functional>
#include <assert.h>
#include <ctime>
#include <utility>
#define SI(i) scanf("%d", &i)
#define SII(i,j) scanf("%d%d", &i, &j)
#define SIII(i,j, k) scanf("%d%d%d", &i, &j, &k)
#define SF(i) scanf("%lf", &i)
#define SFF(i,j) scanf("%lf%lf", &i, &j)
#define SFFF(i,j, k) scanf("%lf%lf%lf", &i, &j, &k)
#define SL(i) scanf("%I64d", &i)
#define SLL(i,j) scanf("%I64d%I64d", &i, &j)
#define SLLL(i,j, k) scanf("%I64d%I64d%I64d", &i, &j, &k)
#define SS(i) scanf("%s\n", i)
#define SSS(i,j) scanf("%s %s", i, j)
#define SC(i) scanf("%d", &i)
#define SCC(i,j) scanf("%c %c\n", &i, &j)

#define PI(i) printf("%d ", i)
#define PII(i,j) printf("%d %d ", i, j)
#define PL(i) printf("%I64d ", i)
#define PLL(i,j) printf("%I64d %I64d ", i, j)
#define PS(i) printf("%s", i)
#define PSS(i,j) printf("%s %s ", i, j)
#define PC(i) printf("%c", i)
#define PCC(i,j) printf("%c %c ", i, j)
#define PN printf("\n")
#define forin(i, k, n) for(int i = (k); i < (n); ++i)
#define forin2(i, k, n) for(int i = (k); i <= (n); ++i)
#define rforin(i, k, n) for(int i = (k); i > (n); --i)
typedef unsigned long long ull;
using namespace std;
int n, t[26];
bool was;
char s[201], ans;
int main() {
#ifdef _DEBUG
	freopen("1.in", "rt", stdin);
	freopen("1.out", "wt", stdout);
#endif
	SI(n);
	SS(s);
	sort(s, s + n);
	ans = s[0];
	if (n < 4)
	{
		if (n == 1)
			PS(s);
		else if (n == 2)
		{
			if (s[0] == s[1])
				PC(s[0]);
			else
				PC('B' + 'G' + 'R' - s[0] - s[1]);
		}
		else
		{
			if (s[0] == s[2])
				PC(s[0]);
			else if (s[0] == s[1])
			{
				PC('B' + 'G' + 'R' - s[0] - s[2]);
				PC(s[2]);
			}
			else if (s[1] == s[2])
			{
				PC('B' + 'G' + 'R' - s[0] - s[2]);
				PC(s[0]);
			}
			else
				PS(s);
		}
		return 0;
	}
	forin(i, 0, n)
	{
		++t[s[i] - 'A'];
		if (i > 0 && s[i] != s[i - 1])
			was = true;
	}
	if (!was)
		PC(ans);
	else if (t['B' - 'A'] > 0 && t['G' - 'A'] > 0 && t['R' - 'A'] > 0)
		PS("BGR");
	else if (t['B' - 'A'] == 0)
	{
		if (t['G' - 'A'] > 1 && t['R' - 'A'] > 1)
			PS("BGR");
		else if (t['G' - 'A'] > 1)
			PS("BR");
		else if (t['R' - 'A'] > 1)
			PS("BG");
	}
	else if (t['G' - 'A'] == 0)
	{
		if (t['B' - 'A'] > 1 && t['R' - 'A'] > 1)
			PS("BGR");
		else if (t['B' - 'A'] > 1)
			PS("GR");
		else if (t['R' - 'A'] > 1)
			PS("BG");
	}
	else //if (t['R' - 'A'] == 0)
	{
		if (t['G' - 'A'] > 1 && t['B' - 'A'] > 1)
			PS("BGR");
		else if (t['G' - 'A'] > 1)
			PS("BR");
		else if (t['B' - 'A'] > 1)
			PS("GR");
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define     int     long long
#define     M       1e9 + 7
#define     po      int t; cin>>t; while(t--)
#define     endl    "\n"

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

void bolt() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

int32_t main()
{
    bolt();

 	int n;
 	cin>>n;

 	int r, g, b;
 	r = g = b = 0;

 	for(int i=1; i<=n; i++) {
 		char c;
 		cin>>c;
 		if(c == 'R')
 			r++;
 		else if(c == 'G')
 			g++;
 		else
 			b++;
 	}

 	if((r>=1 and g>=1 and b>=1) or (r>=2 and g>=2) or (r>=2 and b>=2) or (g>=2 and b>=2)) {
 		cout<<"BGR";
 	}
 	else if(r==1 and g==0 and b==0)
 		cout<<"R";
 	else if(r==0 and g==1 and b==0)
 		cout<<"G";
 	else if(r==0 and g==0 and b==1)
 		cout<<"B";
 	else if(r==1 and g==1 and b==0)
 		cout<<"B";
 	else if(r==1 and g==0 and b==1)
 		cout<<"G";
 	else if(r==0 and g==1 and b==1)
 		cout<<"R";
 	else if(r>=2 and (g==1 and b==0) or (b==1 and g==0))
 		cout<<"BG";
 	else if(g>=2 and (r==1 and b==0) or (b==1 and r==0))
 		cout<<"BR";
 	else if(b>=2 and (r==1 and g==0) or (g==1 and r==0))
 		cout<<"GR";

    return 0;
}

//ITNOG
#include <bits/stdc++.h>
using namespace std;
const int maxN = 1e+5  +20;
#define ll long long
int main()
{
	int  n;
	string ans = "";
	cin >> n;
	string s;
	cin >>s;
	map < char , int> a;
	for(int i = 0 ; i < n; i ++ )
	{
		if (ans.find(s[i] ) >=ans.size() )
			ans+=s[i] ;
		a[s[i] ] ++;
	}
	if ( ans.size() == 3 )
		return cout<<"BGR"<<endl , 0;
	else if (ans.size() == 1 )
		return cout<<ans<<endl , 0;
	sort(ans.begin() , ans.end() );
	 if ( ans == "GR" )
	{
		if ( a['G'] == 1 && a['G'] < a['R'] || a['G'] > 1  && a['G'] <= a['R'] )
			cout<<"BG"<<endl;
		else if ( a['R'] == 1 && a['R'] < a['G'] || a['R'] > 1  && a['R'] <= a['G'] )
			cout<<"BR"<<endl;
		else
			cout<<"B"<<endl;
	}
	else if ( ans == "BG" )
	{
		if ( a['B'] == 1 && a['B'] < a['G'] || a['B'] > 1 && a['B'] <=a['G'] )
			cout<<"BR"<<endl;
		else if (a['G'] == 1 && a['G'] < a['B'] || a['G'] > 1 && a['G'] <=a['B']  )
			cout<<"GR"<<endl;
		else
			cout<<"R"<<endl;
	}
	else if ( ans == "BR" )
	{
		if ( a['R'] == 1 && a['R'] < a['B'] || a['R'] > 1 && a['R']<=a['B'] )
			cout<<"BG"<<endl;
		else if (a['B'] == 1 && a['B'] < a['R'] || a['B'] > 1 && a['B'] <=a['R']  )
			cout<<"GR"<<endl;
		else
			cout<<"G"<<endl;
	}
}

#include<bits/stdc++.h>
using namespace std;
const int N=1234567;
map<string,char> m;

int main() {
   //freopen("in.txt","r",stdin);
   //freopen("out.txt","w",stdout);
   string s;
   cin>>s;
   int n=s.length();
   int a[3]={0};
   char p[]="BGR";
   for(int i=0;i<s.length();i++)
   {
     if(s[i]=='B')
     a[0]++;
     else if(s[i]=='G')
     a[1]++;
     else
     a[2]++;
   }
   //cout<<a['R']<<a['G']<<a['B']<<endl;
   if(a[1]==0&&a[2]==0)
   {
    printf("B");
    return 0;
   }
   if(a[2]==0&&a[0]==0)
   {
    printf("G");
    return 0;
   }
   if(a[0]==0&&a[1]==0)
   {
    printf("R");
    return 0;
   }
   for(int i=0;i<3;i++)
   {
    if(n-a[i]>1)
      printf("%c",p[i]);

   }

}

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
typedef long long ll;
int main() {
	int n;
	cin >> n;
	string s;
	cin >> s;
	int num1=0,num2=0,num3=0;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='B')
			num1++;
		if(s[i]=='G')
			num2++;
		if(s[i]=='R')
			num3++;
	}
	int count=0;
	if(num1==0)
		count++;
	if(num2==0)
		count++;
	if(num3==0)
		count++;
	bool check1=false,check2=false,check3=false;
	//0 x y
	if(count==3||(count==1&&num1>0)||(count==2&&num1==0)||(count==2&&(num2>1||num3>1)))
		check1=true;
	if(count==3||(count==1&&num2>0)||(count==2&&num2==0)||(count==2&&(num1>1||num3>1)))
		check2=true;
	if(count==3||(count==1&&num3>0)||(count==2&&num3==0)||(count==2&&(num2>1||num1>1)))
		check3=true;
	if(check1)
		cout << 'B';
	if(check2)
		cout << 'G';
	if(check3)
		cout << 'R';
	cout << endl;
	//
    return 0;

}

#include <bits/stdc++.h>

using namespace std;

int n;
string str;

int main() {
	ios_base::sync_with_stdio(0);
	int a = 0;
	int b = 0;
	int c = 0;
	cin >> n >> str;
	for (int i = 0; i < str.size(); i++) {
		if (str[i] == 'B') a++;
		if (str[i] == 'G') b++;
		if (str[i] == 'R') c++;
	}
	if (a && b && c) cout << "BGR" << endl;
	else if (a == 1 && b == 1) cout << 'R' << endl;
	else if (a == 1 && c == 1) cout << 'G' << endl;
	else if (b == 1 && c == 1) cout << 'B' << endl;
	else if (a == 1 && b > 1) cout << "BR" << endl;
	else if (a > 1 && b == 1) cout << "GR" << endl;
	else if (a == 1 && c > 1) cout << "BG" << endl;
	else if (a > 1 && c == 1) cout << "GR" << endl;
	else if (b > 1 && c == 1) cout << "BR" << endl;
	else if (b == 1 && c > 1) cout << "BGR" << endl;
	else if (a > 1 && b > 1) cout << "BGR" << endl;
	else if (b > 1 && c > 1) cout << "BGR" << endl;
	else if (a > 1 && c > 1) cout << "BGR" << endl;
	else if (a) cout << 'B' << endl;
	else if (b) cout << 'G' << endl;
	else if (c) cout << 'R' << endl;
	return 0;
}

#include <iostream>
#include <string>
using namespace std;
main()
{
    int n,g=0,r=0,b=0;
    string s;
    cin>>n>>s;
    //n=s.size();
    for(int i=0;i<n;i++)
    {
        if(s[i]=='B') b++;
        else if(s[i]=='R') r++;
        else g++;
    }
    if(n==1) cout<<s;
    else if(n==2)
    {
        if(g==0) cout<<"G";
        else if(r==0) cout<<"R";
        else cout<<"B";
    }
    else if(r!=0 && g!=0 && b!=0)
    {
        cout<<"BGR";
    }
    else if(g>0 && r==0 && b==0) cout<<"G";
    else if(b>0 && r==0 && g==0) cout<<"B";
    else if(r>0 && b==0 && g==0) cout<<"R";
    else
    {
        if(g==0)
        {
            if(r>1&& b==1) cout<<"BG";
            else if(b>1 && r==1) cout<<"GR";
            else cout<<"BGR";
        }
        else if(b==0)
        {
            if(r>1 && g==1) cout<<"BG";
            else if(g>1 && r==1) cout<<"BR";
            else cout<<"BGR";
        }
        else{
            if(b>1 && g==1) cout<<"GR";
            else if(g>1 && b==1) cout<<"BR";
            else cout<<"BGR";
        }
    }
}

#include<iostream>
#include<string.h>
#include<string>
using namespace std;
int main()
{
	int n, r, g, b; string card;
	while (cin >> n)
	{
		cin >> card;
		r = 0, g = 0, b = 0;
		for (int i = 0; i < card.length(); i++)
		{
			if (card[i] == 'R')r++;
			else if (card[i] == 'G')g++;
			else b++;
		}
		if (r >= 1 && g >= 1 && b >= 1)printf("BGR\n");
		else if (r == 0) {
			if (b > g)
			{
				if (g == 0)printf("B\n");
				else if(b%2==1&&g%2==1) printf("GR\n");
				else printf("BGR\n");
			}
			else if (b < g)
			{
				if (b == 0)printf("G\n");
				else if(b % 2 == 1 && g % 2 == 1)printf("BR\n");
				else printf("BGR\n");
			}
			else if (b == g)printf("R\n");
		}
		else if (b == 0)
		{
			if (r > g)
			{
				if (g == 0)printf("R\n");
				else if(r%2==1&&g%2==1) printf("BG\n");
				else printf("BGR\n");
			}
			else if (r < g)
			{
				if (r == 0)printf("G\n");
				else if (r % 2 == 1 && g % 2 == 1)printf("BR\n");
				else printf("BGR\n");
			}
			else if (r == g)printf("B\n");
		}
		else if (g == 0)
		{
			if (r > b)
			{
				if (b == 0)printf("R\n");
				else if(r%2==1&&b%2==1) printf("BG\n");
				else printf("BGR\n");
			}
			else if (r < b)
			{
				if (r == 0)printf("B\n");
				else if (r % 2 == 1 && b % 2 == 1) printf("RG\n");
				else printf("BGR\n");
			}
			else if (b == r)printf("G\n");
		}
	}
	return 0;
}

//#include<iostream>
//#include<string.h>
//#include<string>
//using namespace std;
//bool visited[26][26];
//string path[680],temp;
//int p, q,total,prep,preq;//p��q��
//bool travel(int num)
//{
//	if (num == total)return true;
//	for (int i = 0; i < q; i++)
//	{
//		if (abs(i - preq) == 1)
//		{
//			if (prep - 2 >= 0 && !visited[prep - 2][i])
//			{
//				visited[prep - 2][i] = true;
//				path[num++] = (i + 'A') + (prep-2 + '0');
//				if (!travel(num)) {
//					num--; visited[prep - 2][i] = false;
//				}
//				else { prep -= 2; preq = i; }
//			}
//			else if (prep + 2 < p && !visited[prep + 2][i])
//			{
//				visited[prep + 2][i] = true; temp = i + 'A';
//				path[num] += temp;
//				temp = (prep + 2 + '0'); path[num++] += temp;
//				if (!travel(num)) {
//					num--; visited[prep + 2][i] = false;
//				}
//				else { prep += 2; preq = i; }
//			}
//		}
//		if (abs(i - preq) == 2)
//		{
//			if (prep - 1 >= 0 && !visited[prep - 1][i])
//			{
//				visited[prep - 1][i] = true;
//				path[num++] = (i + 'A') + (prep - 1 + '0');
//				if (!travel(num)) {
//					num--; visited[prep - 1][i] = false;
//				}
//				else { prep -= 1; preq = i; }
//			}
//			else if (prep + 1 < p && !visited[prep + 1][i])
//			{
//				visited[prep + 1][i] = true;
//				path[num++] = (i + 'A') + (prep + 1 + '0');
//				if (!travel(num)) {
//					num--; visited[prep + 1][i] = false;
//				}
//				else { prep += 1; preq = i; }
//			}
//		}
//		if (num == total)return true;
//	}
//	return false;
//}
//int main()
//{
//	int n,vnum; cin >> n;
//	for (int i = 1; i <= n; i++)
//	{
//		cin >> p >> q; total = p * q;
//		vnum = 0;
//		memset(visited, false, sizeof(visited));
//
//		path[vnum] = "A1"; prep = 0, preq = 0;
//		if (i != 1)cout << endl;
//		printf("Scenario #%d:\n", i);
//		if (travel(++vnum)) {
//			for (int j = 0; j < total; j++)
//				cout << path[j];
//			cout << endl;
//		}
//		else printf("impossible\n");
//	}
//	return 0;
//}

//#include<iostream>
//#include<string>
//#include<string.h>
//using namespace std;
//int main()
//{
//	int n,i,c; cin >> n;
//	string num; bool ns[10];
//	while (n--)
//	{
//		memset(ns, false, sizeof(ns)); c = 0;
//		cin >> num;
//		for (i = 0; i < num.length(); i++)
//			if (num[i] >= '0'&&num[i] <= '9')
//			{
//				ns[num[i] - '0'] = true; c++;
//			}
//		if (c % 2 == 0)
//		{
//
//		}
//		else
//		{
//
//
//		}
//	}
//	return 0;
//}

//#include<iostream>
//#include<string>
//using namespace std;
//int main()
//{
//	string a, b;
//	while (cin >> a >> b)
//	{
//
//	}
//	return 0;
//}

//#include<iostream>
//using namespace std;
//long long v1 = 1000000000,v2=1,mid,x,y,a1,a2,a3,t1,t2;
//bool ifOk(long long v)
//{
//	a1 = v - v / x;
//	a2 = v - v / y;
//	a3 = a1 + a2 - (v - v / (x*y));
//	if (a3 - a1 >= t1)
//	{
//		if (a2 >= t2) {
//
//		return true;
//		 }
//	}
//	else {
//		if (a1 >= t1)
//			if (a1 + a2 - a3 >= t1 + t2) {
//		return true;
//		}
//	}
//	return false;
//}
//int main()
//{
//	while (cin >> t1 >> t2 >> x >> y)
//	{
//		while (1)
//		{
//			mid = (v1 + v2) / 2;
//			if (ifOk(mid)) { v1 = mid; }
//			else { v2 = mid + 1; }
//			if (v2 - v1>=0)break;
//		}
//		cout << v2<<endl;
//	}
//	return 0;
//}

#include <bits/stdc++.h>
#define se second
#define fi first
#define pb push_back
#define ct cout
using namespace std;
int main ()
{
int a,i;
vector < char > my;
bool used[5]={};
string b;
cin>>a>>b;
for (i=0;i<a;i++)
{

if (b[i]==b[i+1])
{
if (b[i]=='G' && used[3]==false){
my.pb(b[i]);
used[3]=true;
}
if (b[i]=='B' && used[2]==false){
my.pb(b[i]);
used[2]=true;
}
if (b[i]=='R' && used[1]==false){
my.pb(b[i]);
used[1]=true;
}
}
else{
    if ((b[i]=='G' && b[i+1]=='B') || (b[i]=='B' && b[i+1]=='G')){b[i+1]='R';if (used[1]==false){my.pb('R');used[1]=true;};}
    else if ((b[i]=='G' && b[i+1]=='R') || (b[i]=='R' && b[i+1]=='G')){b[i+1]='B';if (used[2]==false){my.pb('B');used[2]=true;};}
    else {b[i+1]='G';if (used[3]==false){my.pb('G');used[3]=true;}}
}
}
for (i=0;i<my.size();i++)cout<<my[i];
}

/** Source code by WDragon **/
#include<bits/stdc++.h>
#define ll long long
#define MAX 1000003
#define pii pair<int,int>
#define VP vector< pii >
#define MOD 1000000007
#define mp make_pair
#define pb push_back
#define rep(i,a,b) for(int (i) = (a); (i) < (b); (i)++)
#define S(x) scanf("%d",&(x))
#define S2(x,y) scanf("%d%d",&(x),&(y))
#define P(x) printf("%d\n",(x))
#define all(v) (v).begin(),(v).end()
#define FF first
#define SS second
using namespace std;
//int dx[]={1,0,0,-1},dy[]={0,1,-1,0};
int a,b,c;
int main(){
int n;
S(n);
rep(i,0,n){
	char ch;
	scanf(" %c",&ch);
	if(ch=='R')
		++a;
	else if(ch=='G')
		++b;
	else if(ch=='B')
		++c;
}
if((a>=1 && b>=1 && c>=1) ||(a>=2 && b>=2)||(b>=2 && c>=2)||(a>=2 && c>=2))
	printf("RBG\n");
else if(a==1 && b==1 && c==0){
	printf("B\n");
}
else if(b==1 && c==1 && a==0){
	printf("R\n");
}
else if(a==1 && c==1 && b==0){
	printf("G\n");
}
else if(a==2 && b<=1 && c<=1){
	printf("BG\n");
}
else if(b==2 && c<=1 && a<=1){
	printf("BR\n");
}
else if(c==2 && a<=1 && b<=1){
	printf("GR\n");
}
else if(a>0)
printf("R\n");
else if(b>0)
printf("G\n");
else
printf("B\n");
return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
	//freopen("in.txt","r",stdin);
	int a;
	while(cin>>a)
	{
		//cout<<a<<endl;
		int ar[3];
		ar[0]=0,ar[1]=0,ar[2]=0;
		string s;
		char c;
		cin>>s;
		//cout<<s<<endl;
		for(int i=0;i<a;i++)
		{
			//cin>>c;
			c=s[i];
			if(c=='R')ar[0]=1;
			if(c=='B')ar[1]=1;
			if(c=='G')ar[2]=1;
		}
		int lol=ar[1]+ar[2]+ar[0];
		//cout<<lol<<" "<<a<<endl;
		if(lol==3)
		{
			cout<<"BGR"<<endl;
			continue;
		}
		if(lol==1)
		{
			if(ar[0]==1)cout<<"R"<<endl;
			if(ar[1]==1)cout<<"B"<<endl;
			if(ar[2]==1)cout<<"G"<<endl;
			continue;
		}
		if(lol==2 and a==2)
		{

			if(ar[0]==0)cout<<"R"<<endl;
			if(ar[1]==0)cout<<"B"<<endl;
			if(ar[2]==0)cout<<"G"<<endl;
			continue;
		}
		if(lol==2 and a==3)
		{
			ar[0]=0,ar[1]=0,ar[2]=0;
			for(int i=0;i<a;i++)
			{
			//cin>>c;
				c=s[i];
				if(c=='R')ar[0]++;
				if(c=='B')ar[1]++;
				if(c=='G')ar[2]++;
			}
			if(ar[0]==2)cout<<"BG"<<endl;
			if(ar[1]==2)cout<<"GR"<<endl;
			if(ar[2]==2)cout<<"BR"<<endl;
			continue;
		}
		if(lol==2 and a>=4)
		{
			cout<<"BGR"<<endl;
			continue;
		}
	}
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string.h>
#include <string>
#include <set>
#include <map>
#include <stack>
#define rep(i,n) for(i=0;i<n;i++)
#define rtp(i,n) for(i=1;i<=n;i++)
#define rsp(it,s) for(set<int>::iterator it=s.begin();it!=s.end();it++)
#define mod 1000000007
#define ll long long
#define pi acos(-1.0)
using namespace std;
map<char,int>s;

int main()
{
    int i,j,m,n,k;
    scanf("%d",&n);
    char a[210];
    scanf("%s",a);
    rep(i,n)s[a[i]]++;
    if(s['G']&&s['R']&&s['B'])s['b']=s['g']=s['r']=1;
    else if(s['B']&&s['G'])
    {
        s['r']=1;
        if(s['B']>s['G'])s['g']=1;
        else if(s['G']>s['B'])s['b']=1;
    }
    else if(s['R']&&s['G'])
    {
        s['b']=1;
        if(s['R']>s['G'])s['g']=1;
        else if(s['G']>s['R'])s['r']=1;
    }
    else if(s['B']&&s['R'])
    {
        s['g']=1;
        if(s['B']>s['R'])s['r']=1;
        else if(s['R']>s['B'])s['b']=1;
    }
    else if(s['B'])
        s['b']=1;
    else if(s['G'])
        s['g']=1;
    else if(s['R'])
        s['r']=1;
    if(s['b'])printf("B");
    if(s['g'])printf("G");
    if(s['r'])printf("R");
    printf("\n");
    //system ("pause");
    return 0;
}

#include<iostream>
#include<fstream>
#include<algorithm>
#include<math.h>
#include<cmath>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<list>
#include<unordered_map>
#include<stack>
#include<queue>
using namespace std;
int main()
{
	// FO2SH
	int n,b=0,g=0,r=0;
	set<char>s1;
	set<char>::iterator it;
	cin>>n;
	string s;
	cin>>s;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='B')
			b++;
		else if(s[i]=='G')
			g++;
		else
			r++;
		s1.insert(s[i]);
	}

	if(s1.size()==1)
		cout<<*s1.begin()<<endl;
	else if(s1.size()==2)
	{
		if(b%2==1&&g%2==1&&b==g)
			cout<<"R"<<endl;
		else if(b%2==1&&g%2==1&&b>g)
			cout<<"GR"<<endl;
		else if(b%2==1&&g%2==1&&b<g)
			cout<<"BR"<<endl;
		else if(r%2==1&&g%2==1&&r==g)
			cout<<"B"<<endl;
		else if(r%2==1&&g%2==1&&r>g)
			cout<<"BG"<<endl;
		else if(r%2==1&&g%2==1&&r<g)
			cout<<"BR"<<endl;
		else if(r%2==1&&b%2==1)
			cout<<"G"<<endl;
		else if(r%2==1&&b%2==1&&b>r)
			cout<<"GR"<<endl;
		else if(r%2==1&&b%2==1&&b<r)
			cout<<"BG"<<endl;
		else if(b%2==0&&b!=0&&g%2==1&&b>g)
			cout<<"GR"<<endl;
		else if(g%2==0&&g!=0&&b%2==1&&g>b)
			cout<<"BR"<<endl;
		else if(b%2==0&&b!=0&&r%2==1&&b>r)
			cout<<"GR"<<endl;
		else if(r%2==0&&r!=0&&b%2==1&&r>b)
			cout<<"BG"<<endl;

		else if(r%2==0&&r!=0&&g%2==1&&r>g)
			cout<<"BG"<<endl;
		else if(g%2==0&&g!=0&&r%2==1&&g>r)
			cout<<"BR"<<endl;
		else
			cout<<"BGR"<<endl;
	}
	else
		cout<<"BGR"<<endl;

	return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <fstream>
#include <map>
#include <iostream>
#include <utility>
#include <set>
#include <algorithm>
#include <bitset>
#include <queue>
#include <functional>
#include <assert.h>
#include <ctime>
#include <utility>
#define SI(i) scanf("%d", &i)
#define SII(i,j) scanf("%d%d", &i, &j)
#define SIII(i,j, k) scanf("%d%d%d", &i, &j, &k)
#define SF(i) scanf("%lf", &i)
#define SFF(i,j) scanf("%lf%lf", &i, &j)
#define SFFF(i,j, k) scanf("%lf%lf%lf", &i, &j, &k)
#define SL(i) scanf("%I64d", &i)
#define SLL(i,j) scanf("%I64d%I64d", &i, &j)
#define SLLL(i,j, k) scanf("%I64d%I64d%I64d", &i, &j, &k)
#define SS(i) scanf("%s\n", i)
#define SSS(i,j) scanf("%s %s", i, j)
#define SC(i) scanf("%d", &i)
#define SCC(i,j) scanf("%c %c\n", &i, &j)

#define PI(i) printf("%d ", i)
#define PII(i,j) printf("%d %d ", i, j)
#define PL(i) printf("%I64d ", i)
#define PLL(i,j) printf("%I64d %I64d ", i, j)
#define PS(i) printf("%s", i)
#define PSS(i,j) printf("%s %s ", i, j)
#define PC(i) printf("%c", i)
#define PCC(i,j) printf("%c %c ", i, j)
#define PN printf("\n")
#define forin(i, k, n) for(int i = (k); i < (n); ++i)
#define forin2(i, k, n) for(int i = (k); i <= (n); ++i)
#define rforin(i, k, n) for(int i = (k); i > (n); --i)
typedef unsigned long long ull;
using namespace std;
int n, t[26];
bool was;
char s[201], ans;
int main() {
#ifdef _DEBUG
	freopen("1.in", "rt", stdin);
	freopen("1.out", "wt", stdout);
#endif
	SI(n);
	SS(s);
	sort(s, s + n);
	ans = s[0];
	if (n < 4)
	{
		if (n == 1)
			PC(s);
		else if (n == 2)
		{
			if (s[0] == s[1])
				PS(s[0]);
			else
				PC('B' + 'G' + 'R' - s[0] - s[1]);
		}
		else
		{
			if (s[0] == s[2])
				PC(s[0]);
			else if (s[0] == s[1])
			{
				PC('B' + 'G' + 'R' - s[0] - s[2]);
				PC(s[2]);
			}
			else if (s[1] == s[2])
			{
				PC('B' + 'G' + 'R' - s[0] - s[2]);
				PC(s[0]);
			}
			else
				PS(s);
		}
		return 0;
	}
	forin(i, 0, n)
	{
		++t[s[i] - 'A'];
		if (i > 0 && s[i] != s[i - 1])
			was = true;
	}
	if (!was)
	{
		PC(ans);
		return 0;
	}
	if (t['B' - 'A'] > 0 && t['G' - 'A'] > 0 && t['R' - 'A'] > 0)
	{
		PS("BGR");
		return 0;
	}
	if (t['B' - 'A'] == 0)
	{
		if (t['G' - 'A'] > 1 && t['R' - 'A'] > 1)
			PS("BGR");
		else if (t['G' - 'A'] > 1)
			PS("BR");
		else if (t['R' - 'A'] > 1)
			PS("BG");
	}
	else if (t['G' - 'A'] == 0)
	{
		if (t['B' - 'A'] > 1 && t['R' - 'A'] > 1)
			PS("BGR");
		else if (t['B' - 'A'] > 1)
			PS("GR");
		else if (t['R' - 'A'] > 1)
			PS("BG");
	}
	else if (t['R' - 'A'] == 0)
	{
		if (t['G' - 'A'] > 1 && t['B' - 'A'] > 1)
			PS("BGR");
		else if (t['G' - 'A'] > 1)
			PS("BR");
		else if (t['B' - 'A'] > 1)
			PS("GR");
	}
	return 0;
}

#include <bits/stdc++.h>

using namespace std;
int a[300] ;
set< char > s ;
set< char >::iterator it ;
int main()
{
    int n ;
    string ss ;
    cin>>n>>ss ;
    for( int i = 0 ; i < n ; ++i )
    {
        ++a[ ss[i] ] ;
        s.insert( ss[i] ) ;
    }
    it = s.begin() ;
    if( s.size() == 3 )
    {
        cout<<"BRG\n" ;
        return 0 ;
    }

    if( s.size() == 1 )
    {
        cout<<*it ;
        return 0 ;
    }

    if( s.size() == 2 )
    {
        char c1 = *it ;
        ++it ;
        char c2 = *it ;
        char c3 = c1 ;
        c1 = min( c1 , c2 ) ;
        c2 = max( c2 , c3 ) ;
        vector< char > v ;
        if( a[ c2 ] > 1 && a[ c1 ] == 1 )v.push_back(c1);
        if( a[ c1 ] > 1 && a[ c2 ] == 1 )v.push_back(c2);
        if( !a['B'] )v.push_back('B');
        if( !a['G'] )v.push_back('G');
        if( !a['R'] )v.push_back('R');
        sort( v.begin() , v.end() ) ;
        cout<<v[0]<<v[1]<<endl;
    }
    return 0;
}

#include<iostream>
#include<string.h>
#include<string>
using namespace std;
int main()
{
	int n, r, g, b; string card;
	while (cin >> n)
	{
		cin >> card;
		r = 0, g = 0, b = 0;
		for (int i = 0; i < card.length(); i++)
		{
			if (card[i] == 'R')r++;
			else if (card[i] == 'G')g++;
			else b++;
		}
		if (r >= 1 && g >= 1 && b >= 1)printf("BGR\n");
		else if (r == 0) {
			if (b > g)
			{
				if (g == 0)printf("B\n");
				else if(g==1) printf("GR\n");
				else printf("BGR\n");
			}
			else if (b < g)
			{
				if (b == 0)printf("G\n");
				else if(b== 1)printf("BR\n");
				else printf("BGR\n");
			}
			else if (b == g)printf("R\n");
		}
		else if (b == 0)
		{
			if (r > g)
			{
				if (g == 0)printf("R\n");
				else if(g==1) printf("BG\n");
				else printf("BGR\n");
			}
			else if (r < g)
			{
				if (r == 0)printf("G\n");
				else if (r == 1)printf("BR\n");
				else printf("BGR\n");
			}
			else if (r == g)printf("B\n");
		}
		else if (g == 0)
		{
			if (r > b)
			{
				if (b == 0)printf("R\n");
				else if(b==1) printf("BG\n");
				else printf("BGR\n");
			}
			else if (r < b)
			{
				if (r == 0)printf("B\n");
				else if (r == 1 ) printf("RG\n");
				else printf("BGR\n");
			}
			else if (b == r)printf("G\n");
		}
	}
	return 0;
}

//#include<iostream>
//#include<string.h>
//#include<string>
//using namespace std;
//bool visited[26][26];
//string path[680],temp;
//int p, q,total,prep,preq;//p��q��
//bool travel(int num)
//{
//	if (num == total)return true;
//	for (int i = 0; i < q; i++)
//	{
//		if (abs(i - preq) == 1)
//		{
//			if (prep - 2 >= 0 && !visited[prep - 2][i])
//			{
//				visited[prep - 2][i] = true;
//				path[num++] = (i + 'A') + (prep-2 + '0');
//				if (!travel(num)) {
//					num--; visited[prep - 2][i] = false;
//				}
//				else { prep -= 2; preq = i; }
//			}
//			else if (prep + 2 < p && !visited[prep + 2][i])
//			{
//				visited[prep + 2][i] = true; temp = i + 'A';
//				path[num] += temp;
//				temp = (prep + 2 + '0'); path[num++] += temp;
//				if (!travel(num)) {
//					num--; visited[prep + 2][i] = false;
//				}
//				else { prep += 2; preq = i; }
//			}
//		}
//		if (abs(i - preq) == 2)
//		{
//			if (prep - 1 >= 0 && !visited[prep - 1][i])
//			{
//				visited[prep - 1][i] = true;
//				path[num++] = (i + 'A') + (prep - 1 + '0');
//				if (!travel(num)) {
//					num--; visited[prep - 1][i] = false;
//				}
//				else { prep -= 1; preq = i; }
//			}
//			else if (prep + 1 < p && !visited[prep + 1][i])
//			{
//				visited[prep + 1][i] = true;
//				path[num++] = (i + 'A') + (prep + 1 + '0');
//				if (!travel(num)) {
//					num--; visited[prep + 1][i] = false;
//				}
//				else { prep += 1; preq = i; }
//			}
//		}
//		if (num == total)return true;
//	}
//	return false;
//}
//int main()
//{
//	int n,vnum; cin >> n;
//	for (int i = 1; i <= n; i++)
//	{
//		cin >> p >> q; total = p * q;
//		vnum = 0;
//		memset(visited, false, sizeof(visited));
//
//		path[vnum] = "A1"; prep = 0, preq = 0;
//		if (i != 1)cout << endl;
//		printf("Scenario #%d:\n", i);
//		if (travel(++vnum)) {
//			for (int j = 0; j < total; j++)
//				cout << path[j];
//			cout << endl;
//		}
//		else printf("impossible\n");
//	}
//	return 0;
//}

//#include<iostream>
//#include<string>
//#include<string.h>
//using namespace std;
//int main()
//{
//	int n,i,c; cin >> n;
//	string num; bool ns[10];
//	while (n--)
//	{
//		memset(ns, false, sizeof(ns)); c = 0;
//		cin >> num;
//		for (i = 0; i < num.length(); i++)
//			if (num[i] >= '0'&&num[i] <= '9')
//			{
//				ns[num[i] - '0'] = true; c++;
//			}
//		if (c % 2 == 0)
//		{
//
//		}
//		else
//		{
//
//
//		}
//	}
//	return 0;
//}

//#include<iostream>
//#include<string>
//using namespace std;
//int main()
//{
//	string a, b;
//	while (cin >> a >> b)
//	{
//
//	}
//	return 0;
//}

//#include<iostream>
//using namespace std;
//long long v1 = 1000000000,v2=1,mid,x,y,a1,a2,a3,t1,t2;
//bool ifOk(long long v)
//{
//	a1 = v - v / x;
//	a2 = v - v / y;
//	a3 = a1 + a2 - (v - v / (x*y));
//	if (a3 - a1 >= t1)
//	{
//		if (a2 >= t2) {
//
//		return true;
//		 }
//	}
//	else {
//		if (a1 >= t1)
//			if (a1 + a2 - a3 >= t1 + t2) {
//		return true;
//		}
//	}
//	return false;
//}
//int main()
//{
//	while (cin >> t1 >> t2 >> x >> y)
//	{
//		while (1)
//		{
//			mid = (v1 + v2) / 2;
//			if (ifOk(mid)) { v1 = mid; }
//			else { v2 = mid + 1; }
//			if (v2 - v1>=0)break;
//		}
//		cout << v2<<endl;
//	}
//	return 0;
//}

#include <iostream>
#include <bits/stdc++.h>
#include <stdio.h>
#include <string.h>
#define mem(a,b) memset(a,b,sizeof(a))
const int MAXN=1e6+5;
using namespace std;
int main()
{
    int n;
    cin>>n;
    string str,ans;
    cin>>str;
    int R=0,G=0,B=0;
    if(str.length()<2)
    {
        cout<<str<<endl;
        return 0;
    }
    for(int i=0;i<str.length();i++)
    {
        if(str[i]=='R')
            R++;
        else if(str[i]=='G')
            G++;
        else if(str[i]=='B')
            B++;
    }
  //  cout<<R<<" "<<G<<" "<<B<<endl;
    if(str.length()==2)
    {
        if(R==0&&G==1&&B==1||R==2)
            cout<<"R"<<endl;
        else if(G==0&&R==1&&B==1||G==2)
            cout<<"G"<<endl;
        else if(B==0&&R==1&&G==1||B==2)
            cout<<"B"<<endl;

        return 0;
    }
    else
    {
        if(R==0&&G==1&&B==n-1)
            cout<<"GR"<<endl;
        else if(R==0&&G==n-1&&B==1)
            cout<<"RB"<<endl;
        else if(G==0&&R==1&&B==n-1)
            cout<<"GR"<<endl;
        else if(G==0&&R==n-1&&B==1)
            cout<<"BG"<<endl;
        else if(B==0&&G==n-1&&R==1)
            cout<<"BR"<<endl;
        else if(B==0&&G==1&&R==n-1)
            cout<<"BG"<<endl;
        else if(G==n&&R==0&&B==0)
            cout<<"G"<<endl;
        else if(R==n&&G==0&&B==0)
            cout<<"R"<<endl;
        else if(B==n&&G==0&&R==0)
            cout<<"B"<<endl;
        else
            cout<<"BGR"<<endl;
        return 0;
    }
    return 0;
}

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>

#define optimize ios_base::sync_with_stdio(false)
#define mp make_pair
#define fc first
#define sc second
#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)

using namespace std;
typedef pair<int,int> pii;
typedef pair<long long, pair<int, int>> plii;

typedef long long lint;
typedef unsigned long long ulint;
#define MOD 1000000007
#define MAXN 2000
#define MAXX 1000000000000

lint fmin(lint a, lint b)
{
    return a < b? a: b;
}
lint fmax(lint a, lint b)
{
    return a > b? a: b;
}
int getBit(int n, int pos)
{
    return (n >> pos) & 1;
}

int setBit(int n, int pos, int val)
{
    if (val == 0)
        return (n & (~(1 << pos)));
    return n | (1 << pos);
}
bool ss(int a, int b){return a > b;}

lint ucln(lint a, lint b)
{
    while ( a != 0 && b != 0)
    {
        if (a > b)
            a = a % b;
        else b = b % a;
    }
    return a + b;
}

int ok[401][401][401];

int check(int a, int b, int c){
	if (ok[a][b][c] == 1)
		return 0;

	ok[a][b][c] = 1;
	if (a > 0 && b > 0)
		check(a - 1, b - 1, c + 1);
	if (a > 0 && c > 0)
		check(a - 1, b + 1, c - 1);
	if (b > 0 && c > 0)
		check(a + 1, b - 1, c - 1);
	if (a > 1)
		check(a - 1, b, c);
	if (b > 1)
		check(a, b - 1, c);
	if (c > 1)
		check(a, b, c - 1);
	return 0;
}

int main()
{
    optimize;
	int r = 0, g = 0, b = 0, n, i, j, k;
	string s;
	cin >> n;
	cin >> s;
	for (int i = 0; i < n; i++){
		if (s[i] == 'R') r++;
		if (s[i] == 'G') g++;
		if (s[i] == 'B') b++;
	}
	REP(i, 401)
		REP(j, 401)
			REP(k, 401) ok[i][j][k] = 0;

	check(r, g, b);
	if (ok[1][0][0]) cout << "R";
	if (ok[0][1][0]) cout << "G";
	if (ok[0][0][1]) cout << "B";
	//	cout << endl;
}

#include<bits/stdc++.h>
	using namespace std;
	#define pb push_back
	#define tr(it,ct) for(auto &(it) : ct)
	#define  F first
	#define  S second
	#define clr(a,b) memset((a), (b), sizeof(a))
	#define  lld long long int
	#define optimize()   ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	#define all(c) (c).begin(),(c).end()
	typedef pair< lld, lld > pii;
	typedef map<lld,lld> mii;
	typedef map<char,lld>sii;
	typedef vector<lld>vi;
	#define ref 998244353
	#define  mp make_pair

	lld x,y,cnt1=0,cnt2;
	int rail[401][401],road[401][401],dist[401];
	bool vis[401];

	int cnt[2]={0};

 lld power(lld x, lld y, lld p)
{
    lld ans = 1;

    x = x % p;

    while (y > 0)
    {

        if (y & 1)
            ans = (ans*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return ans;

	}

	int fact(int n);

int nCr(int n, int r)
{
    return fact(n) / (fact(r) * fact(n - r));
}

// Returns factorial of n
int fact(int n)
{
    int res = 1;
    for (int i = 2; i <= n; i++)
        res = res * i;
    return res;
}

/*void isBipartite(lld src,int col)
{

	if(vis[src])return;
	vis[src]=true;
	color[src]=col;

	for(int i=0;i<adj[src].size();i++)
	{
		int h = adj[src][i];
		if(vis[h]&&color[h]==color[src]&&h!=src){cout<<"-1";exit(0);}
		else if (!vis[h])
		{
			isBipartite(h,!col);
		}
	}

} */
int dfs(int src,int dest,int g[][401])

{
vis[src]=1;
for(int i=0;i<=dest;i++)dist[i]=1e7;
dist[src]=0;
 queue<int>q;
q.push(src);
while(!q.empty())
{
	int top = q.front();
q.pop();
if(top==dest)return dist[dest];
for(int i=0;i<=dest;i++){
            if(vis[i]) continue;
            if(i != top && g[i][top]){
                if(dist[i] > dist[top] + 1){
                    dist[i] = dist[top] + 1;
                    q.push(i);
                }
            }
}

}
return dist[dest];
}

 int modInverse(lld n, lld p)
{
    return power(n, p-2, p);
}

void jai_mata_di()
{
 lld q;lld k1,k2,n,x,r=0,g=0,b=0,y,i,j,k,cnt=0,flag=0,sum=0,ans=0,d,mx=-1e13;

string s;
cin>>n>>s;n=s.size();
for(i=0;i<n;i++)
{
	if(s[i]=='R')r++;else if(s[i]=='G')g++;
	else b++;
}
if(r!=0)cnt++;if(g!=0)cnt++;if(b!=0)cnt++;cout<<cnt<<" ";
if(cnt==3){cout<<"RGB";return;}
if(cnt==1){cout<<s[0];return;}
if(cnt==2)
{
if(r==0)
{
if(g==1&&b==1)cout<<'R';
else if(g==1&&b>1)cout<<"RG";
else if(b==1&&g>1){cout<<"RB";}
else cout<<"RGB";
}
else if(g==0)
{
if(r==1&&b==1)cout<<'G';
else if(r==1&&b>1)cout<<"RG";
else if(b==1&&r>1){cout<<"GB";}
else cout<<"RGB";
}
else
{
if(g==1&&r==1)cout<<'B';
else if(g==1&&r>1)cout<<"BG";
else if(r==1&&g>1){cout<<"RB";}
else cout<<"RGB";
}
}

 }

	signed main()
	{
	  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	  lld tt=1.0*clock();
	   #ifndef ONLINE_JUDGE

	   freopen("input.txt", "r", stdin);

	   freopen("output.txt", "w", stdout);

	   freopen("error.txt","w", stderr);
	   #endif

	  int t;

	//cin>>t;

	t=1;

	for(int y=0;y<t;y++)
	  { // cout<<"Scenario #"<<i<<":\n";
	   jai_mata_di();
	 cout<<endl;

	  }

	 return 0;
	}

#include <bits/stdc++.h>
using namespace std;
#define INT(a) scanf("%d",&a)
#define STR(a) scanf("%s",a)
#define DBL(a) scanf("%lf",&a)
#define LNG(a) scanf("%lld",&a)
#define PI acos(-1)

bool memo[210][210][210], b, g, r;

void dp(int a, int b, int c){
	if(a<=0 && b<=0 && c<=0) return;

	if(a+b+c==1){
		if(a) b=1;
		if(b) g=1;
		if(c) r=1;
		return;
	}

	if(memo[a][b][c]) return;

	if(a>1) dp(a-1, b, c);
	if(b>1) dp(a, b-1, c);
	if(c>1) dp(a, b, c-1);
	if(a&&b) dp(a-1, b-1, c+1);
	if(b&&c) dp(a+1, b-1, c-1);
	if(a&&c) dp(a-1, b+1, c-1);
	memo[a][b][c]=1;
}

int main(){
	int n;
	string s;
	cin>>n>>s;
	int B=0,G=0,R=0;
	for(int i=0;i<n;i++){
		if(s[i]=='B') B++;
		else if(s[i]=='G') G++;
		else R++;
	}
	//cout<<b<<" "<<b<<" "<<g<<endl;

	dp(B,G,R);
	if(b) cout<<"B";
	if(g) cout<<"G";
	if(r) cout<<"R";
	cout<<endl;

	/*if(b && g && r) cout<<"BGR"<<endl;
	else if(b && g){
		if(b>1 && g>1) cout<<"BGR"<<endl;
		else if(b>1) cout<<"GR"<<endl;
		else if(g>1) cout<<"BR"<<endl;
		else cout<<"R"<<endl;
	} else if(g && r){
		if(g>1 && r>1) cout<<"BGR"<<endl;
		else if(g>1) cout<<"BR"<<endl;
		else if(r>1) cout<<"BG"<<endl;
		else cout<<"B"<<endl;
	} else if(b && r){
		if(b>1 && r>1) cout<<"BGR"<<endl;
		else if(b>1) cout<<"GR"<<endl;
		else if(r>1) cout<<"BG"<<endl;
		else cout<<"G"<<endl;
	} else if(b) cout<<"B"<<endl;
	else if(g) cout<<"G"<<endl;
	else cout<<"R"<<endl;*/
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define ff first
#define ss second
#define D(a) cerr << ">> " << #a << " = >" << a << "<" << endl
#define PB push_back
#define FOR(i,a,b) for ( int i = (a); i < (b); ++i )
#define FORD(i,a,b) for ( int i = (a); i >= (b); --i )
#define R1(a) scanf("%d",&a)
#define R2(a,b) scanf("%d%d",&a,&b)
#define R3(a,b,c) scanf("%d%d%d",&a,&b,&c)

const int INF = 1e9+7;

bool test( int b, int g, int r ) {
  if ( ( b && !g && !r ) )
    return true;
  if ( ( b && g ) && test( b - 1, g - 1, r + 1 ) )
    return true;
  if ( ( g && r ) && test( b + 1, g - 1, r - 1 ) )
    return true;
  if ( ( b && r ) && test( b - 1, g + 1, r - 1 ) )
    return true;
  return false;
}

int main( ) {
  int n, r = 0, g = 0, b = 0;
  string s;

  cin >> n >> s;
  FOR( i, 0, n )
    if ( s[i] == 'R' )
      ++r;
    else if ( s[i] == 'G' )
      ++g;
    else
      ++b;
  // b
  if ( test( b, g, r ) )
    cout << "B";
  if ( test( g, b, r ) )
    cout << "G";
  if ( test( r, g, b ) )
    cout << "R";
    return 0;
}

/** coder Mohammad Al-Hussein *_^ */
#include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define mp make_pair
#define mod  1000000007
using namespace std;
int R,G,B;
int a[2];
int dp[201][201][201];
int solve (int r,int g,int b)
{
    int &ret = dp[r][g][b];
    if(ret != -1) return 0;
    dp[r][g][b] = 1;
    if(r+g+b == 1)
    {
        if(r) a[0]++;
        if(g) a[1]++;
        if(b) a[2]++;
    }
    if(r > 1) solve(r-1,g,b);
    if(g > 1) solve(r,g-1,b);
    if(b > 1) solve(r,g,b-1);
    if(r > 0 && g > 0) solve(r-1,g-1,b+1);
    if(r > 0 && b > 0) solve(r-1,g+1,b-1);
    if(g > 0 && b > 0) solve(r+1,g-1,b-1);
}

int main()
{
    memset(dp,-1,sizeof(dp));
    int n;
    cin >> n;
    for(int i=0; i<n; i++)
    {
        char x;
        cin >> x;
        R += (x == 'R');
        G += (x == 'G');
        B += (x == 'B');
    }
    solve(R,G,B);
    if(a[0]) cout << 'R';
    if(a[1]) cout << 'G';
    if(a[2]) cout << 'B';
    return 0;
}

//15 5
//1 2 3 4 5 -1 -3 -4 -5 50 -6 9 -7 4 46

using namespace std;

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <unordered_map>
#include <sstream>
#include <set>
#include <unordered_set>
#include <algorithm>
#include <tuple>
#include <queue>

using namespace std;

void solve() {
	int n;
	scanf("%d\n", &n);
	int B = 0, G = 0, R = 0;
	for (int i = 0; i < n; ++i) {
		char c;
		scanf("%c", &c);
		switch (c) {
		case 'R':
			R++;break;
		case 'G':
			G++;break;
		case 'B':
			B++;break;
		}
	}

	vector< vector< vector<bool > > > d(200, vector< vector< bool > > (200, vector<bool> (200, false) ) );
	d[R][G][B] = true;

	for (int sum = n; sum >= 0; --sum) {
		for (int r = 0; r < sum; ++r)
			for (int g = 0; g <= sum - r; ++g) {
				int b = sum - r - g;
				if (d[r][g][b]) {
					if (r >= 2)
						d[r - 2][g][b] = true;
					if (g >= 2)
						d[r][g - 1][b] = true;
					if (b >= 2)
						d[r][g][b - 1] = true;
					if (r >= 1 && g >= 1)
						d[r - 1][g - 1][b + 1] = true;
					if (r >= 1 && b >= 1)
						d[r - 1][g + 1][b - 1] = true;
					if (g >= 1 && b >= 1)
						d[r + 1][g - 1][b - 1] = true;
				}
			}
	}
	string ans;
	if (d[0][0][1])
		ans.append("B");
	if (d[0][1][0])
		ans.append("G");
	if (d[1][0][0])
		ans.append("R");
	cout << ans;
}

int main() {
#ifdef LANGO
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    solve();
    return 0;
}

#include<bits/stdc++.h>

#define ll long long
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);
#define sz size()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(s) s.begin(), s.end()
#define file(s) freopen(s".in","r",stdin); freopen(s".out","w",stdout);
using namespace std;
int n;
string d;
char type[] = {'B', 'G', 'R'};
int main () {
	map<char, int> s;
	cin >> n >> d;
	for(int i = 0; i < n; i++)
		s[d[i]]++;
	if (s['R']  && s['G']  && s['B'] ){
    	cout << "BGR";
		return 0;
    }
    if (s['R']  && !s['G'] && !s['B']){
    	cout << "R";
		 return 0;
    }
    if (!s['R'] && s['G']  && !s['B']){
    	cout << "G";
		 return 0;
    }
	if (s['R'] == 0 && s['G'] == 0 && s['B'] ){
    	cout << "B";
		 return 0;
    }
    if (s['R'] == 1 && s['G'] == 1 && s['B'] == 0){
    	cout << "B";
		 return 0;
    }
    if (s['R'] == 1 && s['G'] == 0 && s['B'] == 1){
    	cout << "G";
		 return 0;
    }
	if (s['R'] == 0 && s['G'] == 1 && s['B'] == 1){
    	cout << "R"; return 0;
    }
	if(s['G'] > 1 && s['R'] == 1 && !s['B']){
		cout << "BR"; return 0;
		return 0;
	}
	if(!s['G']  && s['R'] == 1 && s['B'] == 2){
		cout << "GR"; return 0;
	}
	if(s['G'] == 1 && !s['R'] && s['B'] == 2){
		cout << "GR"; return 0;
	}
	if(!s['G']  && s['R'] > 1 && s['B'] == 1){
		cout << "BG"; return 0;
	}
	if(s['G']  == 2 && !s['R'] && s['B'] == 1){
		cout << "BR"; return 0;
	}
	if(s['G'] == 1 && s['R'] > 1 && !s['B']){
		cout << "BG"; return 0;
	}
	cout << "BGR";
}

#include <bits/stdc++.h>
#include<cmath>
#include<set>
#include<iterator>
using namespace std;
#define test() ll t;cin>>t;while(t--)
#define MOD 1000000007
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ff              first
#define ss              second
#define ll              long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define vb              vector<bool>
#define mii             map<int,int>
#define mpar            map<pii,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mx   1e6

void solve()
{
    int l;
    cin>>l;
    string s;
    cin>>s;
    int r=0,b=0,g=0;
    for(int i=0;i<l;i++)
    {
        if(s[i]=='R')
            r++;
        if(s[i]=='B')
            b++;
        if(s[i]=='G')
            g++;
    }
    if(r==0 && b==0 )
    {
        cout<<"G"<<endl;return;    }
    if(b==0 && g==0)
        {cout<<"R"<<endl;return;}
    if(r==0 && g==0)
        {cout<<"B"<<endl;return;}
    if(l==2)
    {
        if(r==0) {cout<<"R";return;}
        if(b==0) {cout<<"B";return;}
        if(g==0) {cout<<"G";return;}
    }
    if(r+b ==1) {cout<<"RB";return;}
    if(b+g == 1) {cout<<"GB";return;}
    if(g+r ==1) {cout<<"RG";return;}
    cout<<"GRB"<<endl;
}

int main()
{
	SPEED
    //code

    solve();
}

#include <iostream>
#include <vector>
#include <deque>
#include <string>
#include <list>
#include <algorithm>
#include <cmath>
#include <fstream>
using namespace std;
typedef signed long long int lli;
typedef vector<int> vi;
typedef vector<long long> vll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,a,b) for( x(a); x<b; x++)
#define ALL(a) (a.begin()),(a.end())
#define sqr(x) ((x)*(x))
#define sqrt(x) sqrt(1.0*(x))
#define pow(x,n) pow(1.0*(x),n)
#define SPause system("pause")
#define FORI(n) for(int i=0;i<n;i++)
#define FORJ(n) for(int j=0;j<n;j++)
#define FORT(n) for(int i=0,temp(0);i<n;i++)
#define sz(V) (int)V.size()
#define pb push_back
int main ()
{
	int N,B(0),G(0),R(0);
	cin >> N;
	string str;
	cin >>str;

	FORI(N)
	{
		if (str[i]=='B') B++;
		else if (str[i]=='G') G++;
		else if (str[i]=='R') R++;
	}
	if ((R*B*G)!=0) {cout << "BGR"; return 0; }
	if ((B==0) && (G==0)) {cout << "R";return 0;}
	if ((B==0) && (R==0)) {cout << "G";return 0;}
	if ((G==0) && (R==0)) {cout << "B";return 0;}
	if (B==0) if (R==G==1) {cout << "B";return 0;} else if (R==1) {cout << "BR";return 0;} else if (G==1) {cout << "BG";return 0;}
	if (G==0) if (R==B==1) {cout << "G";return 0;} else if (R==1) {cout << "GR";return 0;} else if (B==1) {cout << "GB";return 0;}
	if (R==0) if (B==G==1) {cout << "R";return 0;} else if (B==1) {cout << "BR";return 0;} else if (G==1) {cout << "GR";return 0;} else  {cout << "BGR";return 0;}
	//SPause;
return 0;
}

#include <iostream>
#include <map>
using namespace std;

int main(){
	int tam;
	cin >> tam;
	string s;
	cin >> s;
	map<char, int> cont;
	for(int i=0; i<tam; i++) cont[s[i]]++;
	if(cont['R'] && cont['G'] && cont['B']){
		cout << "BGR" << endl;
		return 0;
	}
	if(cont['R'] && cont['G']){
		if(cont['R']%2==cont['G']%2){
			cout << "B" << endl;
			return 0;
		}
		if(!(cont['R']%2) && cont['G']%2){
			cout << "BG" << endl;
			return 0;
		}
		if(!(cont['G']%2) && cont['R']%2){
			cout << "BR" << endl;
			return 0;
		}
	}
	if(cont['B'] && cont['G']){
		if(cont['B']%2==cont['G']%2){
			cout << "R" << endl;
			return 0;
		}
		if(!(cont['B']%2) && cont['G']%2){
			cout << "GR" << endl;
			return 0;
		}
		if(!(cont['G']%2) && cont['B']%2){
			cout << "BR" << endl;
			return 0;
		}
	}
	if(cont['R'] && cont['B']){
		if(cont['R']%2==cont['B']%2){
			cout << "G" << endl;
			return 0;
		}
		if(!(cont['R']%2) && cont['B']%2){
			cout << "BG" << endl;
			return 0;
		}
		if(!(cont['B']%2) && cont['R']%2){
			cout << "GR" << endl;
			return 0;
		}
	}
	if(cont['R']){
		cout << "R" << endl;
		return 0;
	}
	if(cont['G']){
		cout << "G" << endl;
		return 0;
	}
	if(cont['B']){
		cout << "B" << endl;
		return 0;
	}
	return 0;
}

#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <map>
#include <stack>
#include <string>
#include <set>
#include <sstream>
#include <algorithm>
#include <fstream>
#include <deque>
using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long
#define pii pair<int, int>
#define f first
#define s second
#define all(a) a.begin(), a.end()
#define sz(a) (int)a.size()

const int inf = (int)1e9;
const int mod = inf+7;

int n, used[10];
set<char> s;

void make(int a, int b, int c){

	if(a!=0 && b==0 && c==0){
		s.insert('R');
		return;
	}
	if(a==0 && b!=0 && c==0){
		s.insert('B');
		return;
	}
	if(a==0 && b==0 && c!=0){
		s.insert('G');
		return;
	}
	if(a>1){
		make(a-1, b, c);
	}
	if(b>1){
		make(a, b+1, c);
	}
	if(c>1){
		make(a, b, c-1);
	}
	if(a>0 && b>0){
		make(a-1, b-1, c+1);
	}
	if(a>0 && c>0){
		make(a-1, b+1, c-1);
	}
	if(b>0 && c>0){
		make(a+1, b-1, c-1);
	}
}

int main(){

	scanf("%d", &n);
	for(int i=0;i<n;i++){
		char c;
		cin >> c;
		if(c=='R'){
			used[1]++;
		}else if(c=='B'){
			used[2]++;
		}else if(c=='G'){
			used[3]++;
		}
	}

	if(used[1]!=0 && used[2]==0 && used[3]==0){
		printf("R\n");
		return 0;
	}else if(used[2]!=0 && used[1]==0 && used[3]==0){
		printf("B\n");
		return 0;
	}else if(used[3]!=0 && used[1]==0 && used[2]==0){
		printf("G\n");
		return 0;
	}
	if(used[1]>0 && used[2]>0 && used[3]>0){
		printf("RGB\n");
		return 0;
	}

	if(used[1]>0 && used[2]>0){
		make(used[1], used[2], 0);
	}else if(used[2]>0 && used[3]>0){
		make(0, used[2], used[3]);
	}else if(used[1]>0 && used[3]>0){
		make(used[1], 0, used[3]);
	}

	set<char>::iterator it;
	for(it=s.begin();it!=s.end();it++){
		cout << (*it);
	}

	return 0;
}

#include <cstdio>
#include <iostream>
#include <cstring>
#include <vector>
#include <queue>
#include <algorithm>
#include <list>
#include <cmath>
using namespace std;
#define MS0(I) memset(I, 0, sizeof(I));
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, s, n) for(int i = (s); i < (n); ++i)
#define MAX 205
typedef long long LL;
typedef unsigned long long ULL;
char store[MAX];
int kount[3];
int main(void){
    int n; scanf("%d", &n);
    scanf("%s", store);
    rep(i, n){
        if(store[i] == 'B') kount[0]++;
        else if(store[i] == 'G') kount[1]++;
        else kount[2]++;
    }
    rep(i, 3) if(kount[i] >= 2) kount[i] = 1;
    if(kount[0] && kount[1] && kount[2]) putchar('B');
    else{
        if(kount[0] == 1) putchar('B');
        if(kount[1] == 1) putchar('G');
        if(kount[2] == 1) putchar('R');
    }
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <string.h>
#include <fstream>

using namespace std;

const int INF = 1000000007;

int n, k;

string s;
int b, g, r;
char col;

int main() {
	//freopen("inp.txt", "rt", stdin);
	//freopen("out.txt", "wt", stdout);

	cin >> n;

	for (int i = 0; i < n; i++)
	{
		cin >> col;
		if (col == 'B') b++;
		if (col == 'G') g++;
		if (col == 'R') r++;
	}

	if (b && g && r)
	{
		cout << "BRG\n";
		return 0;
	}

	if (b > 1 && g)
	{
		cout << "RG\n";
		return 0;
	}

	if (r > 1 && g)
	{
		cout << "BG\n";
		return 0;
	}

	if (g > 1 && b)
	{
		cout << "BR\n";
		return 0;
	}

	if (r && g)
	{
		cout << "B\n";
		return 0;
	}

	if (b && g)
	{
		cout << "R\n";
		return 0;
	}

	if (b && r)
	{
		cout << "G\n";
		return 0;
	}

	if (!b)
	{
		cout << "B\n";
		return 0;
	}

	if (!r)
	{
		cout << "R\n";
		return 0;
	}

	if (!g)
	{
		cout << "G\n";
		return 0;
	}

	return 0;
};

#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
string cards,output="";
cin >> cards;
map<char,int> m;
for(int i=0;i<cards.size();i++)
{
	m[cards[i]]++;
}
if(m.size()==3)
output="RGB";
else if(m.size()==2)
{
	if(m['B']&&m['G']){
	output.append("R");
	if(m['B']>=2)
		output.append("G");
	if(m['G']>=2)
		output.append("B");

}
	if(m['R']&&m['G']){
	output.append("B");
	if(m['R']>=2)
		output.append("G");
	if(m['G']>=2)
		output.append("R");
}
	if(m['B']&&m['R']){
	output.append("G");
	if(m['B']>=2)
		output.append("R");
	if(m['R']>=2)
		output.append("B");
}
}
else
output=cards[0];
cout << output << "\n";
}

#include<iostream>
#include<string>
using namespace std;
int main()
{
	int n;
	while(cin>>n)
	{
		int F[3]={0};
		int cl=0;
		char G;
		char H[3]={'B','G','R'};
		for(int j=0;j<n;j++)
		{
			cin>>G;
			switch(G){
				case'B':F[0]++;continue;
				case'G':F[1]++;continue;
				case'R':F[2]++;continue;
			}

		}//cout<<F[0]<<" "<<F[1]<<" "<<F[2]<<endl;
		for(int j=0;j<3;j++)
		{
			if(F[j]>0)
				cl++;
		}
		switch(cl){
			case 1:for(int j=0;j<3;j++)
				{
					if(F[j]>0)
						cout<<H[j]<<endl;
				}continue;
			case 2:if((F[0]+F[1]+F[2])==2)
					{
						for(int j=0;j<3;j++)
						{
							if(F[j]==0)
								cout<<H[j];
						}
					}
					else
					{
						for(int j=0;j<3;j++)
						{
							if(F[j]==0||(F[j])%2==1)
								cout<<H[j];
						}
					}
					cout<<endl;
					continue;
			case 3:cout<<"BGR"<<endl;
		}
	}
}

#include <iostream>
#include <vector>
#include <string>
#include <bits/stdc++.h>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <deque>
#include <tuple>
#include <unordered_set>

using namespace std;
using ld = long double;
using ll = long long;

int main()
{
	int n;
	cin >> n;
	string s;
	cin >> s;

	unordered_set<int> pos;

	deque<tuple<int, int, int>> q;
	q.push_back(make_tuple(count(s.begin(), s.end(), 'R'), count(s.begin(), s.end(), 'G'), count(s.begin(), s.end(), 'B')));
	int arr[3] = {};
	string lol = "RGB";
	while (q.size() > 0) {
		tuple<int, int, int> x = q.front(); q.pop_front();
		int i = get<0>(x); int j = get<1>(x); int k = get<2>(x);
		if (i+j+k == 1) {
			if (i) {
				arr[0] = 1;
			} else if (j) {
				arr[1] = 1;
			} else {
				arr[2] = 1;
			}
			continue;
		}
		if (i > 1) q.push_back(make_tuple(i-1, j, k));
		if (j > 1) q.push_back(make_tuple(i, j-1, k));
		if (k > 1) q.push_back(make_tuple(i, j, k-1));
		if (i && j) q.push_back(make_tuple(i-1, j-1, k+1));
		if (i && k) q.push_back(make_tuple(i-1, j+1, k-1));
		if (k && j) q.push_back(make_tuple(i+1, j-1, k-1));
	}
	for (int i=0; i<3; i++) {
		if (arr[i]) {
			cout << lol[i];
		}
	}

	return 0;
}

#include <bits/stdc++.h>
#define ROCK ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define f first
#define sec second
using namespace std;
typedef  long long int ll;
const long long int linf =(ll)9e18;

const int N=305;
int n,R,G,B,dp[N][N][N];
string s,ans;

bool solve(int cntR,int cntG,int cntB){
    if(cntR + cntG + cntB ==1){
        if(cntR)ans=ans+'R';
        if(cntG)ans=ans+'G';
        if(cntB)ans=ans+'B';
        return 1;
    }int &ret=dp[cntR][cntG][cntB];
    if(~ret)return ret;
    ret=0;
    if(cntR-2>=0)ret|=solve(cntR-1,cntG,cntB);
    if(cntG-2>=0)ret|=solve(cntR,cntG-1,cntB);
    if(cntB-2>=0)ret|=solve(cntR,cntG,cntB-1);
    if(cntR && cntG)ret|=solve(cntR-1,cntG-1,cntB+1);
    if(cntR && cntB)ret|=solve(cntR-1,cntG+1,cntB-1);
    if(cntG && cntB)ret|=solve(cntR+1,cntG-1,cntB-1);
    return ret;
}

int main()
{
    ROCK;
    memset(dp,-1,sizeof dp);
    cin>>n>>s;
    for(int i=0;i<s.size();i++){
        if(s[i]=='R')R++;
        if(s[i]=='G')G++;
        if(s[i]=='B')B++;
    }solve(R,G,B);
    cout<<ans<<endl;
    return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cmath>

#define ll long long
#define scani(x) scanf("%i", &x)
#define scanll(x) scanf("%I64d", &x)
#define scanfl(x) scanf("%f", &x)
#define scanch(x) scanf("%c", &x)
#define scans(x) scanf("%s", x);
#define printi(x) printf("%i", x);
#define printll(x) printf("%I64d", x);
#define printfl(x) printf("%f", x);
#define printch(x) printf("%c", x);
#define prints(x) printf("%s", x);
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define INF (1LL << 62)

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    ll n, B = 0, G = 0, R = 0, c;
    char l;
    string s;

    cin >> n >> s;

    for(char i:s)
    {
        if(i == 'B')
            B++, l = 'B';
        else if(i == 'G')
            G++, l = 'G';
        else
            R++, l = 'R';
    }

    c = ((B > 0) + (G > 0) + (R > 0));

    if(c == 3)
        cout << "BGR\n";
    else if(c == 1)
        cout << l << "\n";
    else
    {
        if(!B) cout << "B";
        if(!G) cout << "G";
        if(!R) cout << "R";

        if(n == 2)
        {
            cout << "\n";

            return 0;
        }

        if(B && ((B < G) || (B < R)))
            cout << "B";
        if(G && ((G < B) || (G < R)))
            cout << "G";
        if(R && ((R < B) || (R < G)))
            cout << "R";

        cout << "\n";
    }

    return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define ios ios_base::sync_with_stdio(false)
#define pii pair<int, int>
#define fs first
#define sc second

using namespace std;

const ll INF=(1ll<<62)-1;
const int M=1e5+5;

 int main()
    {
        ios;
        int n;
        cin>>n;
        string s;
        cin>>s;
        char ans[205];
        ans[0]=s[0];
        for(int i=1;i<n;i++)
        {
            if(s[i]==s[i-1])ans[i-1]=s[i];
            else if(s[i]=='R' && s[i-1]=='G')ans[i-1]='B',s[i]='B';
            else if(s[i]=='B' && s[i-1]=='G')ans[i-1]='R',s[i]='R';
            else if(s[i]=='G' && s[i-1]=='R')ans[i-1]='B',s[i]='B';
            else if(s[i]=='B' && s[i-1]=='R')ans[i-1]='G',s[i]='G';
            else if(s[i]=='G' && s[i-1]=='B')ans[i-1]='R',s[i]='R';
            else if(s[i]=='R' && s[i-1]=='B')ans[i-1]='G',s[i]='G';

        }

        //int ln=ans.size();

        if(ans[0]==ans[n-2]){
            cout<<ans[0];
            return 0;
        }

        for(int i=0;ans[i];i++)
        {
            cout<<ans[i];
        }
    }

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int INF = 0x3f3f3f3f , MOD = 1e9+7 , maxn = 123456;
struct node
{
    char t;
    int n;
};
node s[5],ss[5];
bool cmp(node s1,node s2)
{
    return s1.n<s2.n;
}
void cp(){for (int i = 1;i <= 3;i++) ss[i]=s[i];}
void mysort(node s[]){sort(s+1,s+4,cmp);}
int main()
{
    int n;
    char temp;
    cin>>n;s[1].t='R';s[2].t='G';s[3].t='B';
    for (int i = 1;i <= n;i++)
    {
        cin>>temp;
        if (temp=='R')s[1].n++;
        else if (temp=='G')s[2].n++;
        else if (temp=='B')s[3].n++;
    }
    mysort(s);char chu[5];int cc=0;
    if (s[2].n==0){cout<<s[3].t;}
    else if (s[1].n==0&&s[2].n!=0)
    {
        cout<<s[1].t<<s[2].t;
    }
    else if (s[1].n!=0&&s[2].n!=0&&s[3].n!=0)
        cout<<"RGB";
    cout<<endl;
    return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define F first
#define S second
#define pb push_back
#define f(i,s,n) for(int i=(int)s;i<=(int)n;++i)
#define fr(i,n,s) for(int i=(int)n;i>=s;--i)
#define all(v) v.begin(),v.end()
#define Fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
void solve()
{
	int n;cin>>n;
	string s;
	cin>>s;
	int R=0,G=0,B=0;
	for(char c:s){
		R+= c=='R';
		B+= c=='B';
		G+= c=='G';
	}
	if(R && G && B){
		cout<<"BGR\n";

	}
	else if(R && B+G==0){
		if(R==1){
			cout<<'R';
		}
		else{
			cout<<"BG";
		}
	}
	else if(G && B+R==0){
		if(G==1){
			cout<<'G';
		}
		else{
			cout<<"BR";
		}
	}
	else if(B && R+G==0){
		if(B==1){
			cout<<'B';
		}
		else{
			cout<<"RG";
		}
	}
	else{
		if(R==1 && G==1  && !B){
			cout<<"B";
		}
		if(B==1 && G==1  && !R){
			cout<<"R";
		}
		if(R==1 && B==1  && !G){
			cout<<"G";
		}
		else if(R==1 && G>1 && !B){
			cout<<"BR";
		}
		else if(G==1 && B>1 && !R){
			cout<<"GR";
		}
		else if( R>1 && B==1 && !G){
			cout<<"BG";
		}
		else
			cout<<"BGR";

	}
}
int main()
{	Fast;
	// int t;cin>>t;
	// while(t--)
	solve();
}

#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define uint unsigned int
#define vi vector<int>

#define for0(i,n) for(int i=0; i<(n); i++)
#define for1(i,n) for(int i=1; i<=(n); i++)
#define from(i,a,b) for(int i=(a); i<=(b); i++)
#define forr(i,a,b) for(int i=(a); i>=(b); i--)

#define pb push_back
#define mp make_pair
#define fi first
#define se second

void amax(int& x, int y){if(x<y)x=y;}
void amin(int& x, int y){if(x>y)x=y;}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n, r=0,g=0,b=0;
    cin >> n;
    string s;
    cin >> s;
    for(char ch:s){
        if(ch=='R')r++;
        else if(ch=='G')g++;
        else b++;
    }

    if(r&&g&&b)cout << "BGR";
    else if(r&&g){
        if(r==1 && g==1)
            cout<<"B";
        else if(r==1)
            cout<<"BR";
        else if(g==1)
            cout<<"BG";
    }
    else if(r&&b){
        if(r==1 && b==1)
            cout<<"G";
        else if(r==1)
            cout<<"BG";
        else if(b==1)
            cout<<"GR";
    }
    else if(b&&g){
        if(b==1 && g==1)
            cout<<"R";
        else if(b==1)
            cout<<"GR";
        else if(g==1)
            cout<<"BR";
    }else{
        cout << (r?"R":(g?"G":"B"));
    }
    cout << '\n';
    return 0;
}

#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
/*
void main() {
	std::string a, b, c;
	bool  a_plus_b = true, a_plus_c = true, b_plus_c = true;
	std::cin >> a >> b >> c;
	int bh1, bh2, bh3, tp1 = 0, tp2 = 0, tp3 = 0, ans;
	char tmp;
	for(int i = 0; i < std::min(a.length(),std::min(b.length(),c.length())); ++i) {
		if(a_plus_b) {
			bh1 = (a[i] - '0' + b[i] - '0') % 10;
			if(bh1 - tp1 != c[i] - '0')
				a_plus_b = false;
			tp1 = (a[i] - '0' + b[i] - '0') - bh1;
			if(i + 1 == std::min(a.length(),std::min(b.length(),c.length()))) {
				if(tp1 && c)
				if(std::abs((int)(a.length() - b.length())) > 0) {

				}

			}
		}
		if(a_plus_c) {
			bh2 = (a[i] - '0' + c[i] - '0') % 10;
			if(bh2 - tp2 != b[i] - '0')
				a_plus_c = false;
			tp2 = (a[i] - '0' + c[i] - '0') - bh2;
		}
		if(b_plus_c) {
			bh3 = (b[i] - '0' + c[i] - '0') % 10;
			if(bh3 - tp3 != c[i] - '0')
				b_plus_c = false;
			tp3 = (b[i] - '0' + c[i] - '0') - bh3;
		}
	}
}

double dist(double x1, double x2, double y1, double y2) {
	return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
}
void main() {
	double new_arr[100][2], n, arr[100][2];
	std::cin >> n;
	for(int i = 0; i < (int)n; ++i){
		std::cin >> arr[i][0] >> arr[i][1];
		new_arr[i][0] = (double)arr[i][0] / dist(arr[i][0], 0, arr[i][1], 0);
		new_arr[i][1] = (double)arr[i][1] / dist(arr[i][0], 0, arr[i][1], 0);
	}
	for(int i = 0; i < n; ++i){
		std::cout << new_arr[i][0] << " " << new_arr[i][1] <<std::endl;
	}
	double min_dist = 10000000;
	for(int i = 0; i < (int)n; ++i) {
		if(min_dist > dist(new_arr[i][0], new_arr[(i+1) % (int)n][0], new_arr[i][1], new_arr[(i+1) % (int)n][1])) {
			min_dist = dist(new_arr[i][0], new_arr[(i+1) % (int)n][0], new_arr[i][1], new_arr[(i+1) % (int)n][1]);
		}
	}
	getchar();
	getchar();
}*/
using namespace std;
int main(){
	int n,r = 0,g = 0,b = 0,m = 0;
	char l[200],ans[3];
	cin>>n;
	for(int i = 0; i < n; ++i){
		cin >> l[i];
		if(l[i] == 'R')
			r++;
		else if(l[i] == 'G')
			g++;
		else
			b++;
	}
	if(r > 0 && g > 0 && b > 0){
		ans[1] = 'G';
		ans[0] = 'R';
		ans[2] = 'B';
		m = 3;
	}
	else if(min(r,max(g,b)) == 0 && min(g,max(b,r)) == 0){
		m = 1;
		if(r != 0)
			ans[0] = 'R';
		else if(g != 0)
			ans[0] = 'G';
		else
			ans[0] = 'B';
	}
	else if(n == 2){
		if(r == 0)
			ans[0] = 'R';
		else if(g == 0)
			ans[0] = 'G';
		else
			ans[0] = 'B';
		m = 1;
	}
	else if(n == 3){
		if(r == 2){
			ans[0] = 'G';
			ans[1] = 'B';
		}
		else if(g == 2){
			ans[0] = 'R';
			ans[1] = 'B';
		}
		else{
			ans[0] = 'R';
			ans[1] = 'G';
		}
		m = 2;
	}
	else{
		if(r == 1 || g == 1 || b == 1){
			if(min(r,g) == 0 && max(r,g) == 1){
				ans[0] = 'R';
				ans[1] = 'G';
			}
			else if(min(r,b) == 0 && max(r,b) == 1){
				ans[0] = 'R';
				ans[1] = 'B';
			}
			else if(min(g,b) == 0 && max(g,b) == 1){
				ans[0] = 'G';
				ans[1] = 'B';
			}
			m = 2;
		}
		else{
			m = 3;
			ans[0] = 'R';
			ans[1] = 'G';
			ans[2] = 'B';
		}
	}
	for(int i = 0; i < m;++i)
		cout<<ans[i];
	return 0;
}

#include<iostream>
#include<cstdio>
#include<cmath>
#include<string.h>
#include<string>
#include<stdlib.h>
#include<queue>
using namespace std;
int n;
char color[205];
bool possible[3];//B G R最后的可能性，可能为1 ，不可能为0
char a[3] = { 'B','G','R' };
int cishu[3];
int main(){
	scanf("%d", &n);
	getchar();
	for (int i = 0; i < n; i++) {
		scanf("%c", &color[i]);
		if (color[i] == 'B') {
			cishu[0]++;
		}
		else if (color[i] == 'G') {
			cishu[1]++;
		}
		else if (color[i] == 'R') {
			cishu[2]++;
		}
	}
	memset(possible, 1, sizeof(possible));
	if (n == 2) {
		memset(possible, 0, sizeof(possible));
		for (int i = 0; i < 3; i++) {
			if (a[i] != color[0] && a[i] != color[1]) {
				possible[i] = 1;
			}
		}
	}
	else {
		for (int i = 0; i < 3; i++) {
			if (cishu[i] == n) {
				possible[i] = 1;
				possible[(i + 1) % 3] = 0;
				possible[(i + 2) % 3] = 0;
			}
			if (cishu[i] == n - 1) {
				possible[(i + 1) % 3] = 1;
				possible[(i + 2) % 3] = 1;
				possible[i] = 0;
			}
		}
	}
	if (possible[0] == 1) printf("B");
	if (possible[1] == 1) printf("G");
	if (possible[2] == 1) printf("R");
	printf("\n");
	return 0;
}

#include<iostream>
#include<utility>
#include<algorithm>
#define ll long long

using namespace std;

int main ()
{
    ll n;
    cin>>n;
    string s;
    cin>>s;
    ll b_ans=0,g_ans=0,r_ans=0;
    //sort(s.begin(),s.end());
    for(ll i=0;i<s.size();i++)
    {
        if(s[i]=='B') {b_ans++;}
        if(s[i]=='R') {r_ans++;}
        if(s[i]=='G') {g_ans++;}
        //cout<<i<<endl;

    }
    //cout<<b_ans<<' '<<g_ans<<' '<<r_ans<<endl;
    if(b_ans>=1 && r_ans>=1 && g_ans>=1)
        cout<<"BGR"<<endl;
    else if((b_ans>1 && r_ans>1) ||(r_ans>1 && g_ans>1) ||(b_ans>1 && g_ans>1))
        cout<<"BGR"<<endl;
    else if(b_ans>1 && r_ans==1 && g_ans==0)
        cout<<"GR"<<endl;
    else if(g_ans>1 && b_ans==1 && r_ans==0)
        cout<<"BR"<<endl;
    else if(r_ans>1 && g_ans==1 && b_ans==0)
        cout<<"BG"<<endl;
    else if((b_ans==1 && r_ans==1)|| g_ans==n)
        cout<<"G"<<endl;
    else if((b_ans==1 && g_ans==1)|| r_ans==n)
        cout<<"R"<<endl;
    else if((g_ans==1 && r_ans==1)|| b_ans==n)
        cout<<"B"<<endl;

    return 0;
}

/*
Author : Arpit Saini
*/
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <cstring>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
using namespace std;
#define ll long long
#define sz(X) ((int)(X).size())
#define all(X) (X).begin(), (X).end()
#define loop(I, N) for (int I = 0; I < (N); ++I)
#define rep(I, A, B) for (int I = (A); I <= (B); ++I)
#define si(X) scanf("%d", &(X))
#define sll(X) scanf("%lld",&(X))
#define sii(X, Y) scanf("%d%d", &(X), &(Y))
#define siii(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define ss(X) scanf("%s", (X))
#define nl(X) printf("\n")
#define mp make_pair
#define pb push_back
#define ms0(X) memset((X), 0, sizeof((X)))
#define ms1(X) memset((X), -1, sizeof((X)))
#define len(X) strlen(X)
#define pii pair<int,int>
#define pll pair<ll ,ll >
#define vi vector<int>
#define vpii vector< pii >
#define vpll vector< pll >
#define fir first
#define sec second
const int mod = 1e9+7;
const int N = 2e2+10;
const int inf = 2e9;
const double eps = 1e-7;
const long long INF = (long long)1e18;
/* -------Template ends here-------- */
char a[N];
int x[10];
int main()
{
	int n;
	cin>>n;
	cin>>a;
	for(int i=0;i<n;i++)
	{
		if(a[i] == 'R')
			x[0]++;
		if(a[i] == 'G')
			x[1]++;
		if(a[i] == 'B')
			x[2]++;
	}
	set<char> ans;
	if(x[0] == x[1] && x[2] == x[0])
	{
		ans.insert('R');
		ans.insert('G');
		ans.insert('B');
	}
	else if(x[0] == x[1] && x[0]!=x[2])
	{
		ans.insert('B');
	}
	else if(x[0] == x[2] && x[0]!=x[1])
	{
		ans.insert('G');
	}
	else if(x[1] == x[2] && x[0]!=x[1])
	{
		ans.insert('R');
	}
	else
	{
		if(x[0] < x[1] && x[0] < x[2])
		{
			ans.insert('R');
			if(x[1] < x[2])
				ans.insert('G');
			else
				ans.insert('B');
		}
		if(x[1] < x[0] && x[1] < x[2])
		{
			ans.insert('G');
			if(x[0] < x[2])
				ans.insert('R');
			else
				ans.insert('B');
		}
		if(x[2] < x[1] && x[2] < x[0])
		{
			ans.insert('B');
			if(x[1] < x[0])
				ans.insert('G');
			else
				ans.insert('R');
		}
	}
	for(set<char> :: iterator it=ans.begin();it!=ans.end();it++)
		cout<<(*it);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main()
{
	int n;
	cin>>n;
	char a;
	long int countg=0,countb=0,countr=0;

	for(int i=0;i<n;i++)
	{
		cin>>a;
		if(a=='G')
		countg++;
		if(a=='B')
		countb++;
		if(a=='R')
		countr++;
	}

	if(countg>=1&&countr==0&&countb==0)
	{
		cout<<"G";
		return 0;
	}

	if(countr>=1&&countg==0&&countb==0)
	{
		cout<<"R";
		return 0;
	}

	if(countb>=1&&countr==0&&countg==0)
	{
		cout<<"B";
		return 0;
	}

	if(countg>=1&&countr>=1&&countb>=1)
	{
		cout<<"BGR";
		return 0;
	}

	if(countg>1&&countr>1&&countb==0)
	{
		cout<<"BGR";
		return 0;
	}

	if(countg==0&&countr>1&&countb>1)
	{
		cout<<"BGR";
		return 0;
	}

	if(countg>1&&countr==0&&countb>1)
	{
		cout<<"BGR";
		return 0;
	}

	if(countg==1&&countr>=1&&countb==0)
	{
		if(countr%2!=0)
		cout<<"BG";
		else
		cout<<"B";
		return 0;
	}

		if(countg==0&&countr>=1&&countb==1)
	{
		if(countr%2!=0)
		cout<<"BG";
		else
		cout<<"G";
		return 0;
	}

		if(countg>=1&&countr==1&&countb==0)
	{
		if(countg%2!=0)
		cout<<"BR";
		else
		cout<<"B";
		return 0;
	}

		if(countg>=1&&countr==0&&countb==1)
	{
		if(countg%2!=0)
		cout<<"BR";
		else
		cout<<"R";
		return 0;
	}

		if(countg==0&&countr==1&&countb>=1)
	{
		if(countb%2!=0)
		cout<<"GR";
		else
		cout<<"G";
		return 0;
	}

		if(countg==1&&countr==0&&countb>=1)
	{
		if(countb%2!=0)
		cout<<"GR";
		else
		cout<<"R";
		return 0;
	}
}

#include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define dbg printf("in\n")
#define nl printf("\n")
#define sf(n) scanf("%d", &n)
#define sff(n,m) scanf("%d%d",&n,&m)
#define sfl(n) scanf("%lld", &n)
#define sffl(n,m) scanf("%lld%lld",&n,&m)
#define pf(n) printf("%d ",n);
#define pfs(s) cout<<s;
#define pb push_back
#define pp pair<string,int>
#define f(a,b,c) for(int a=b;a<c;a++)
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    int r=0,b=0,g=0;
    f(i,0,n)
    {
        if(s[i]=='B')
            b++;
        if(s[i]=='R')
            r++;
        if(s[i]=='G')
            g++;
    }
    vector<int>v={r,g,b};int ctr=0;
    if(v[0]==0)ctr++; if(v[1]==0)ctr++; if(v[2]==0)ctr++;
    if(ctr==0)
    {
        cout<<"BGR\n";
    }
    if(ctr==2)
    {
        cout<<s[0]<<"\n";
    }
    if(ctr==1)
    {
        if(b==2&&r==1)
        {
            cout<<"GR\n";
        }
        else if(r==2&&g==1)
        {
            cout<<"BG\n";
        }
        else if(g==2&&b==1)
        {
            cout<<"BR\n";
        }
        if(b==1&&r==1)
        {
            cout<<"G\n";
        }
        else if(r==1&&g==1)
        {
            cout<<"B\n";
        }
        else if(g==1&&b==1)
        {
            cout<<"R\n";
        }
        else
        {
            cout<<"BGR\n";
        }
    }
}

//Classic
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pi pair<int,int>
#define vp vector<pi>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define For(i,a,b) for(ll i=a;i<b;i++)
#define endl "\n"
#define debug(x) cout<<"AA Baju Smit------> "<<#x<<" -> "<<x<<endl
#define all(x) x.begin(),x.end()
#define mint map<int,int>
#define mod 1000000007
#define ciN cin
#define X INT_MAX
#define N INT_MIN
////////////////////////////////////////////////////////////////
int cap(int r, int b, int g) {
	if (r < 0 || b < 0 || g < 0)return 0;

}
void jabru() {
	int n; ciN >> n;
	string s; cin >> s;
	int r = 0, g = 0, b = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'R')r++;
		else if (s[i] == 'G')g++;
		else
			b++;
	}
	if (r == 0 && g == 0) {
		cout << "B" << endl;
	}
	else if (r == 0 && b == 0) {
		cout << "G" << endl;
	}
	else if (b == 0 && g == 0) {
		cout << "R" << endl;
	}
	else {
		string ans = "";
		if (r > 0 && b > 0 && g > 0) {
			cout << "BGR" << endl; return;
		}
		if (b == 0) {
			ans += 'B';
		}
		else if (b != 0) {
			if (r >= 1 || g >= 1) {
				ans += 'B';
			}
		}
		if (g == 0) {
			ans += 'G';
		}
		else {
			if (b >= 1 || r >= 1) {
				ans += 'G';
			}
		}
		if (r == 0) {
			ans += 'R';
		}
		else {
			if (b >= 1 || g >= 1) {
				ans += 'R';
			}
		}
		if (ans == "") {
			ans = "BGR";
		}
		cout << ans << endl;
	}

}

////////////////////////////////////////////////////////////////

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t;
	//cin >> t;
	t = 1;
	while (t--)
		jabru();

	return 0;
}

///////////////////////////////////////////////////////////////////////////////////////////
//Kai baju bhai???

#include <iostream>
#include <stdio.h>
#include <conio.h>
#include <vector>
#include <string>
using namespace std;
int main()
{
	int n;
	string s;
	cin >> n;
	cin >> s;

	int r=0,g=0,b=0;
	bool R=false,G=false,B=false;
	for (int i = 0; i < n; i++)
	{
		if (s[i]=='R') r++;
		if (s[i]=='G') g++;
		if (s[i]=='B') b++;

	}

	if (r+b==0) G=true;
	if (r+g==0) B=true;
	if (b+g==0) R=true;

	if (r>2) r=2;
	if (g>2) g=2;
	if (b>2) b=2;

	if (r==1 && b ==1 && g==0) G=true;
	if (g==1 && r ==1 && b==0) B=true;
	if (b==1 && g ==1 && r==0) R=true;

		if (b==2 && g==0 && r==1) { R=true;  G=true;}
		if (r==2 && g==0 && b==1) { B=true;  G=true;}
		if (g==2 && b==0 && r==1) { R=true;  B=true;}
		if (b==2 && r==0 && g==1) { R=true;  G=true;}
		if (r==2 && b==0 && g==1) { B=true;  G=true;}
		if (g==2 && r==0 && b==1) { R=true;  B=true;}

		if (g+r==2 && b==0) { R=true; B=true; G=true;}
		if (b+r==2 && g==0) { R=true; B=true; G=true;}
		if (g+b==2 && r==0) { R=true; B=true; G=true;}

		if (g+r+b==4 && r>0 && g>0 && b>0) { R=true; B=true; G=true;}
		if (g+r+b==6 ) { R=true; B=true; G=true;}
		if (g+r+b==3 && r>0 && g>0 && b>0) { R=true; B=true; G=true;}

		if (B==true ) cout << 'B';
		if (G==true ) cout << 'G';
		if (R==true ) cout << 'R';

	//system("pause");

	//GGRR  B,
}

/* fflush(stdout);  */
#include <iostream>
#include <stdio.h>
#include<bits/stdc++.h>
#define ll long long
#define read freopen("input.txt","r",stdin)
#define write freopen("output.txt","w",stdout)
#define fr first
#define sc second
#include <sstream>
#define ii pair < int , int >
using namespace std;
ll gcd(ll a,ll b)
{
    return (b==0 ? a : gcd(b,a%b));
}
ll lcm(ll a,ll b)
{
    return(a*(b/gcd(a,b)));
}
ll bigmod(ll b,ll p ,ll m)
{
    if(p==0)
        return 1;
    if(p%2 == 0)
    {
        ll temp = bigmod(b,p/2,m);
        return (temp*temp)%m;
    }
    return (bigmod(b,p-1,m)*(b%m))%m;
}
vector < vector < int > > v;
vector < bool >  visited;
vector < int > top;
int visit[50];
void dfs(int node)
{
    visited[node] = true;
    for(int i=0 ; i<(int)v[node].size(); i++)
        if(!visited[v[node][i]])
            dfs(v[node][i]);
    top.push_back(node);
}
int connectedcomponenetscnt()
{
    int cnt = 0,n;
    for(int i=1; i<=n; i++)
    {
        if(!visited[i])
        {
            dfs(i);
            cnt++;
        }
    }
    return cnt;
}
int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    int a=0,b=0,c=0;
    for(int i=0; i<s.length(); i++)
    {
        if(s[i] == 'G')
            a++;
        if(s[i] == 'R')
            b++;
        if(s[i] == 'B')
            c++;
    }
    if(a == 1 && b == 1 && c == 0 )
    {
        cout<<'B';
        return 0;
    }
    if(a == 1 && b == 0 && c == 1 )
    {
        cout<<'R';
        return 0;
    }
    if(a == 0 && b == 1 && c == 1 )
    {
        cout<<'G';
        return 0;
    }
    if(a>0&&b>0&&c>0)
    {
        cout<<"BGR";
        return 0;
    }
    if(a == 0 && b == 0)
    {
        cout<<"B";
        return 0;
    }
    if(a == 0 && c == 0)
    {
        cout<<"R";
        return 0;
    }
    if(b == 0 && c == 0)
    {
        cout<<"G";
        return 0;
    }
    if(a>3||b>3||c>3)
    {
        cout<<"BGR";
        return 0;
    }
    if((a>1 && b > 1) || (a>1&&c>1)||(b>1&&c>1))
    {
        cout<<"BGR";
        return 0;
    }
    else
    {
        if(c == 2)
            cout<<"GR";
        if(b == 2)
            cout<<"BG";
        if(a == 2)
            cout<<"BR";

    }
}

// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("unroll-loops")

#include <bits/stdc++.h>
using namespace std;
# define fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl "\n"
#define all(v) v.begin(),v.end()
#define mod1 1000000009
#define mod 1000000007
#define Mod 998244353
#define ha "YES"
#define na "NO"
#define len(s) int(s.size())
#define pb push_back
#define eb emplace_back
#define rev(s) reverse(all(s))
typedef unsigned long long ull;
typedef long long ll;

void IO()
{
#ifndef ONLINE_JUDGE
	freopen("pracin.txt", "r", stdin);
	freopen("pracout.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
#endif
	fast;
}
// vector<bool> used;
// vector<vector<int>> adj;
// vector<int> dir[200005];
// vector<int> a, b;
//bipartite graph or not using bfs

// void bfs(int i)
// {
// 	queue<int> q;
// 	q.push(i);
// 	used[i] = 1;
// 	a.push_back(i);
// 	while (!q.empty())
// 	{	i = q.front();
// 		q.pop();
// 		for (auto vertex : adj[i])
// 		{
// 			if (used[vertex] == -1)
// 			{
// 				used[vertex] = used[i] ^ 1;
// 				if (used[vertex] == 1) a.push_back(vertex);
// 				else b.push_back(vertex);
// 				q.push(vertex);
// 			}
// 			if (used[vertex] == used[i]) {
// 				cout << -1;
// 				exit(0);
// 			}

// 		}

// 	}
// }

// fast exponention (logn)
ll binary_exponention(ll a, ll b) {
	if (b == 0)
		return 1;
	ll res = binary_exponention(a, b / 2);
	if (b % 2)
		return res * res * a % Mod;

	return res * res % Mod;

}

// Chal WA likh ab

inline void read(ll a[], int n, int which = 0)
{
	if (which)
		for (int i = 1; i <= n; i++) cin >> a[i];
	else for (int i = 0; i < n; i++) cin >> a[i];
}
inline void write(ll a[], int n, int which = 0)
{
	if (which == 0)
		for (int i = 0; i < n; i++) cout << a[i] << " ";
	else for (int i = 1; i <= n; i++) cout << a[i] << " ";
}
int dir8i[8] = { -1, -1, 0, 1, 1, 1, 0, -1};

int dir4i[4] = { -1, 0, 1, 0};
int dir4j[4] = {0, -1, 0, 1};

// To Do

// 10580 - Ransom Note
// matrix matcher uva
// extend the palindrome

void  solve()
{

	int n; cin >> n;
	string s; cin >> s;
	set<char> se;
	map<char, int> m;
	for (int i = 0; i < n; i++) se.insert(s[i]), m[s[i]]++;
	sort(all(s));
	if (len(s) == 1)
	{
		cout << s[0];
		return;
	}
	if (len(s) == 2)
	{

		if (s[0] == s[1])
			cout << s[0];
		else {
			if (s[0] == 'B' && s[1] == 'G') cout << 'R';
			else  if (s[0] == 'B' && s[1] == 'R') cout << 'G';
			else cout << "B";
		}
		return;
	}
	if (len(se) == 1)
	{

	}
	else if (len(se) == 3)
	{
		cout << "BGR";
	}
	else {
		if ( (m['R'] > 1 && m['G'] > 1 ) || (m['R'] > 1 && m['B'] > 1) || (m['G'] > 1 && m['B'] > 1))
		{
			cout << "BGR";
		}
		else {
			if (m['R'] && m['G'])
			{
				if (m['R'] > 1 && m['G'] > 1)
					cout << "BGR";
				else {
					if (m['R'] > 1)
						cout << "BG";
					else cout << "BR";
				}
			}
			else if (m['R'] && m['B'])
			{
				if (m['R'] > 1 && m['B'] > 1)
					cout << "BGR";
				else {
					if (m['R'] > 1)
						cout << "BG";
					else cout << "GR";
				}
			}
			else
			{
				if (m['B'] > 1 && m['G'] > 1)
					cout << "BGR";
				else {
					if (m['B'] > 1)
						cout << "GR";
					else cout << "BR";
				}
			}

		}
	}
}

int  main()
{
	IO();

	// int t; cin >> t; while (t--)
	solve();

#ifndef ONLINE_JUDGE
	cerr  << 1.0 * clock() / CLOCKS_PER_SEC << "s\n";
#endif

}

#include <iostream>
#include <map>
using namespace std;

int main(){
	int tam;
	cin >> tam;
	string s;
	cin >> s;
	map<char, int> cont;
	for(int i=0; i<tam; i++) cont[s[i]]++;
	if(cont['R'] && cont['G'] && cont['B']){
		cout << "BGR" << endl;
		return 0;
	}
	if(cont['R'] && cont['G']){
		if(cont['R']-1 && cont['G']-1){
			cout << "BGR" << endl;
			return 0;
		}
		if(!(cont['R']-1)){
			cout << "BR" << endl;
			return 0;
		}
		if(!(cont['G']-1)){
			cout << "BG" << endl;
			return 0;
		}
		if(!(cont['R']-1) && !(cont['G']-1)){
			cout << "B" << endl;
			return 0;
		}
	}
	if(cont['B'] && cont['G']){
		if(cont['B']-1 && cont['G']-1){
			cout << "BGR" << endl;
			return 0;
		}
		if(!(cont['B']-1)){
			cout << "BR" << endl;
			return 0;
		}
		if(!(cont['G']-1)){
			cout << "GR" << endl;
			return 0;
		}
		if(!(cont['B']-1) && !(cont['G']-1)){
			cout << "R" << endl;
			return 0;
		}
	}
	if(cont['R'] && cont['B']){
		if(cont['R']-1 && cont['B']-1){
			cout << "BGR" << endl;
			return 0;
		}
		if(!(cont['R']-1)){
			cout << "GR" << endl;
			return 0;
		}
		if(!(cont['B']-1)){
			cout << "BG" << endl;
			return 0;
		}
		if(!(cont['R']-1) && !(cont['B']-1)){
			cout << "G" << endl;
			return 0;
		}
	}
	if(cont['R']){
		cout << "R" << endl;
		return 0;
	}
	if(cont['G']){
		cout << "G" << endl;
		return 0;
	}
	if(cont['B']){
		cout << "B" << endl;
		return 0;
	}
	return 0;
}