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.

var i,j,n,k,B,R,G:longint;q:char;
begin
 readln(n);
 for i:=1 to n do
 begin
  read(q);
  if q='B' then B:=1+b else
  if q='G' then g:=1+g else
  if q='R' then r:=1+r;
  END;
  k:=100*b+10*g+r;
  if k=111 then write('BGR') ELSE
   if k=110 then write('R') ELSE
   if k=101 then write('G') ELSE
   if k=11 then write('B') ELSE
   if R+G=0 then write('B') ELSE
   if r+b=0 then write('G') ELSE
   if b+g=0 then write('R') ELSE
   if r+b=1 then write('BR') ELSE
   if b+g=1 then write('BG') ELSE
   if r+G=1 then write('GR') ELSE
    write('BGR') ;
end.

var
n, i, k1,k2, k3: integer;
s: string;
begin
readln(n);
readln(s);
for i:= 1 to n do
begin
if s[i] = 'B' then inc(k1);
if s[i] = 'G' then inc(k2);
if s[i] = 'R' then inc(k3);
end;
if (k1 >= 1) and (k2 >= 1) and (k3 >= 1) then begin  writeln('BGR'); exit; end;
if (k1 <> 0) and (k2 = 0) and (k3 = 0) then begin  writeln('B'); exit; end;
if (k1 = 0) and (k2 <> 0) and (k3 = 0) then begin  writeln('G'); exit; end;
if (k1 = 0) and (k2 = 0) and (k3 <> 0) then begin  writeln('R'); exit; end;
if (k1 = 0)
then
begin
if (k2 = 1) and (k3 = 1) then begin  writeln('B'); exit; end;
if (k2 = 1) then begin  writeln('BG'); exit; end;
if (k3 = 1)  then begin  writeln('BR'); exit; end;
 writeln('BGR'); exit;
end;
if (k2 = 0)
then
begin
if (k1 = 1) and (k3 = 1) then begin writeln('G'); exit; end;
if (k1 = 1) then begin  writeln('BG'); exit; end;
if (k3 = 1)  then begin writeln('GR'); exit; end;
 writeln('BGR'); exit;
end;
if (k3 = 0)
then
begin
if (k1 = 1) and (k2 = 1) then begin  writeln('R'); exit; end;
if (k1 = 1) then begin  writeln('BR'); exit; end;
if (k2 = 1)  then begin  writeln('GR'); exit; end;
 writeln('BGR'); exit;
end;
end.

      {$APPTYPE CONSOLE}
const nn=3; besk=2000000000000000000;
   nnn=2000000;  eps=1e-11; modul=1000000007;
 type matr=array[1..3,1..3] of extended;
   mat=^matr;
 label 1,2,3,4;

var i1,j1,k,step,kt,ppp,god,day,mon,mask,i0,j0,i,j,start,finish:longint;
newdl,dloch,kol,shag,m,t,ii,jj,l,r,p,p3,pos,ll,bb,pp,tt,ot1,ot2,s,kold,n:int64;
xx,cc,q,t1,t2,p4,p1,p2,ot,dist1,vt,zap,ba,by,aa,ay,kk,centr,koef:int64;
flag2,flag1,flag:boolean;
ch1,ch2,ch:char;
str:array[-10..12000] of matr;
prob,ccc1,v,rr,h1,h2,h,r1,r2,aaa,bbb,ccc,hh,po,pt,doltek,dolpred:extended;
next,prev,x1,x2,y1,y2,d,och,newoch,f,x,y,fact,c,b,a,prost:array[-100000..1100000] of int64;
oldzan,oldmarked,zan: array[0..330006] of boolean;
gr:array[-1..1001,-1..1001] of boolean;
agor,aver,ssumgor,ssumver,sgor,sver,udd,dostl,dostr: array[-100..600,-100..600] of int64;
det,ott :double;
dd:matr;
d3,d1,d2,dist,edin:matr;
ss,ss1,ss2:string;
za:array[-10..600,-10..600] of boolean;
marked,dost,newdost:array[-10..700000] of boolean;
ssnew:array[-10..1000000] of char;
pole:array[-10..610,-10..600] of char;
name:array[0..2000] of string;
function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

 function nod(x,y:int64):int64; var z:int64;
begin   repeat  z:=x mod y;x:=y;y:=z;   until  z=0 ;  nod:=x;end;

function degg(p,deg:int64):int64; var pp,q:int64;
 begin if deg=0 then degg:=1 else begin   if odd(deg) then degg:=(degg(p,deg-1)*p) mod modul else
 begin q:=(degg(p,deg shr 1)) mod modul; degg:=(q*q) mod modul;   end; end;   end;

begin
 { assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
  }
 readln(n);
  readln(ss);

   for i:=1 to n do
     begin
        if ss[i]='B' then inc(p1);
        if ss[i]='G'  then inc(p2);
        if ss[i]='R'  then inc(p3);

     end;

   if (p1>0)and(p2>0)and(p3>0) then begin  write('BGR'); goto 1; end;
   if p1+p2=0 then begin write('R'); goto 1;  end;
   if p1+p3=0 then begin write('G'); goto 1;  end;
   if p3+p2=0 then begin write('B'); goto 1;  end;

   if (n=2)and(p1=0) then begin write('B'); goto 1;  end;
   if (n=2)and(p2=0) then begin write('G'); goto 1;  end;
   if (n=2)and(p3=0) then begin write('R'); goto 1;  end;

   if (p1>=2)and(p2=1) then begin write('GR'); goto 1;  end;
   if (p1=1)and(p2>=2) then begin write('BR'); goto 1;  end;

   if (p2>=2)and(p3=1) then begin write('BR'); goto 1;  end;
   if (p2=1)and(p3>=2) then begin write('BG'); goto 1;  end;

   if (p1>=2)and(p3=1) then begin write('GR'); goto 1;  end;
   if (p1=1)and(p3>=2) then begin write('BG'); goto 1;  end;

   write('BGR');

   1:          close(output);
end.

program ProjectDCodeforces;

{$APPTYPE CONSOLE}

uses
  SysUtils,Math;

var
  k,i,j,n:integer;
  g,a,b,c,r,d,res:int64;
  s:char;
begin
 // Reset(Input,'input.txt');
 // Rewrite(Output,'output.txt');
  Readln(n);
  r:=0;
  b:=0;
  g:=0;
  for i:=1 to n do
   begin
     read(s);
     case s of
     'R': Inc(r);
     'G': Inc(g);
     'B': Inc(b);
     end;
   end;

  if (r>=1)and(g>=1)and(b>=1)
  then write('BGR')
  else begin
         if (r=0)
         then begin
               if (b>=2)and(g=1)
               then write('GR');
               if (g>=2)and(b=1)
               then write('BR');
               if (b=1)and(g=1)
               then write('R');
               if (g>=2)and(b>=2)
               then write('BGR')
              end;

         if (g=0)
         then begin
               if (b>=2)and(r=1)
               then write('GR');
               if (r>=2)and(b=1)
               then write('BG');
               if (b=1)and(r=1)
               then write('G');
               if (r>=2)and(b>=2)
               then write('BGR')
              end;
         if (b=0)
         then begin
               if (r>=2)and(g=1)
               then write('BG');
               if (g>=2)and(r=1)
               then write('BR');
               if (g=1)and(r=1)
               then write('B');
               if (g>=2)and(r>=2)
               then write('BGR')
              end;
         if (r>0)and(b=0)and(g=0)
         then write('R');
         if (G>0)and(r=0)and(b=0)
         then write('G');
         if (b>0)and(r=0)and(g=0)
         then write('B');
       end;

end.

var
  g, r, b:byte;
  c:char;
  i, n:byte;

BEGIN
  g:=0; r:=0; b:=0;
  readln(n);
  for i:=1 to n do begin
    read(c);
    if c='R' then
      inc(r)
    else if c='G' then
      inc(g)
    else
      inc(b);
  end;

  if r>=1 then begin
    if r>=2 then begin
      if (b>=2) or (g>=2) or ((b>=1) and (g>=1)) then
      write('BGR')
    else if (b>=1) and (g=0) then
      write('BG')
    else if (b=0) and (g=1) then
      write('BG')
    else if (b=0) and (g=0) then
       write('R');
    end
    else begin
      if (b>=1) and (g>=1) then
        write('BGR')
      else if ((b>=2) and (g=0)) then
        write('GR')
      else if ((b=0) and (g>=2))  then
        write('BR')
      else if (r=1) and (b=1) and (g=0) then
        write('G')
      else if (r=1) and (b=0) and (g=1) then
        write('B')
      else if (b=0) and (g=0) then
        write('R');
    end
  end
  else if (b>=1) then  begin
    if (b>=2) and (g>=2) then
      write('BGR')
    else if (b>=2) and (g>=1) then
      write('GR')
    else if(b=1) and (g>=2) then
      write('BR')
    else if (b=1) and (g=1) then
      write('R')
    else if g=0 then
      write('B');
  end
  else if g>=1 then
    write('G');

END.

var
n,i,k,j:longint;
a,b:array[1..100] of longint;
s:string;
begin
readln(n);
readln(s);
//s:='RRRRR';
for i:=1 to n do begin
                 if s[i]='B' then inc(a[1]);
                 if s[i]='G' then inc(a[2]);
                 if s[i]='R' then inc(a[3]);
                 end;
  if a[1]*a[2]*a[3]>0 then begin write('BGR'); halt; end;
  for i:=1 to 3 do if a[i]=0 then begin inc(k); b[i]:=1; end;
  if k=1 then begin
    if b[1]=1 then begin
    if (a[2]>1) and (a[3]>1) then begin write('BGR'); halt; end;
    if (a[2]>1) and (a[3]=1) then begin write('BR'); halt; end;
    if (a[2]=1) and (a[3]>1) then begin write('BG'); halt; end;
    if (a[2]=1) and (a[3]=1) then begin write('B'); halt; end;
    end;
    if b[2]=1 then begin
    if (a[3]>1) and (a[1]>1) then begin write('BGR'); halt; end;
    if (a[3]>1) and (a[1]=1) then begin write('BG'); halt; end;
    if (a[3]=1) and (a[1]>1) then begin write('GR'); halt; end;
    if (a[3]=1) and (a[1]=1) then begin write('G'); halt; end;
    end;
    if b[3]=1 then begin
    if (a[2]>1) and (a[1]>1) then begin write('BGR'); halt; end;
    if (a[2]>1) and (a[1]=1) then begin write('BR'); halt; end;
    if (a[2]=1) and (a[1]>1) then begin write('GR'); halt; end;
    if (a[2]=1) and (a[1]=1) then begin write('R'); halt; end;
    end;
    end;
    if k=2 then begin
    for i:=1 to 3 do if b[i]=0 then begin
    if i=1 then begin write('B'); halt; end;
    if i=2 then begin write('G'); halt; end;
    if i=3 then begin write('R'); halt; end;
    end;
    end;
    end.

type
  mas = array [1..3] of longint;
var
  i, n : longint;
  s : string;
  a, b : mas;
begin
  readln(n);
  readln(s);
  for i := 1 to length(s) do
    begin
      if s[i] = 'B'
        then
          inc(a[1]);
      if s[i] = 'R'
        then
          inc(a[2]);
      if s[i] = 'G'
        then
          inc(a[3]);
    end;
  s := '';
  b := a;
  {inc(b[1], min(b[2], b[3]));
  dec(b[2], min(b[2], b[3]));
  dec(b[3], min(b[3], b[3]));
  if (b[2] = 0) and (b[3] = 0)
    then
      ot := ot + 'B'
  if (b[1] = 0) and (b[2] = 0)
    then
      ot := ot + 'B'
  if (b[1] = 0) and (b[2] = 0)
    then
      ot := ot + 'B'}
  if (a[1] > 0) and (a[2] > 0) and (a[3] > 0)
    then
      begin
        s := 'BGR';
        writeln(s);
        exit;
      end;
  if (a[1] > 0) and (a[2] + a[3] = 0)
    then
      s := 'B';
  if (a[2] > 0) and (a[1] + a[3] = 0)
    then
      s := 'R';
  if (a[3] > 0) and (a[1] + a[2] = 0)
    then
      s := 'G';
  if s <> ''
    then
      begin
        writeln(s);
        exit;
      end;
  if a[1] = 0
    then
      begin
        if (a[2] = 1) and (a[3] = 1)
          then
            s := 'B'
          else
        if (a[2] > 1) and (a[3] = 1)
          then
            s := 'BG'
          else
        if (a[2] = 1) and (a[3] > 1)
          then
            s := 'BR'
          else
        s := 'BGR';
      end;
  if a[2] = 0
    then
      begin
        if (a[1] = 1) and (a[3] = 1)
          then
            s := 'R'
          else
        if (a[1] > 1) and (a[3] = 1)
          then
            s := 'GR'
          else
        if (a[1] = 1) and (a[3] > 1)
          then
            s := 'BR'
          else
        s := 'BGR';
      end;
  if a[3] = 0
    then
      begin
        if (a[1] = 1) and (a[2] = 1)
          then
            s := 'G'
          else
        if (a[1] > 1) and (a[2] = 1)
          then
            s := 'GR'
          else
        if (a[1] = 1) and (a[2] > 1)
          then
            s := 'BG'
          else
        s := 'BGR';
      end;
  writeln(s);
end.

var
i,j,k,n,m,q,w,x,y:longint;
a:array[1..100] of longint;
s:string;
begin
    readln(n);
    read(s);
    for i:=1 to n do
    begin
        if s[i]='R' then inc(a[1]);
        if s[i]='B' then inc(a[2]);
        if s[i]='G' then inc(a[3]);
    end;
    if (a[1]>=1) and (a[2]>=1) and (a[3]>=1) and (n>3) then write('BGR')
    else
    if a[1]=n then write('R')
    else
    if a[2]=n then write('B')
    else
    if a[3]=n then write('G')
    else
    if (a[1]=1) and (a[2]=1) and (a[3]=0) then write('G')
    else
    if (a[1]=1) and (a[3]=1) and (a[2]=0) then write('B')
    else
    if (a[2]=1) and (a[3]=1) and (a[1]=0) then write('R')
    else
    if (a[1]=1) and (a[2]=1) and (a[3]=1) then write('BGR')
    else
    if (a[1]=1) and (a[2]=2) then write('GR')
    else
    if (a[1]=1) and (a[3]=2) then write('BR')
    else
    if (a[2]=1) and (a[1]=2) then write('BG')
    else
    if (a[2]=1) and (a[3]=2) then write('BR')
    else
    if (a[3]=1) and (a[1]=2) then write('BG')
    else
    if (a[3]=1) and (a[2]=2) then write('GR')
    else
    if (a[1]>=3) and (a[2]=1) then write('BG')
    else
    if (a[1]>=3) and (a[3]=1) then write('BG')
    else
    if (a[2]>=3) and (a[1]=1) then write('GR')
    else
    if (a[2]>=3) and (a[3]=1) then write('GR')
    else
    if (a[3]>=3) and (a[1]=1) then write('BR')
    else
    if (a[3]>=3) and (a[2]=1) then write('BR')
    else
    if (a[1]=0) and (a[2]>1) and (a[3]>1) then write('BGR')
    else
    if (a[2]=0) and (a[1]>1) and (a[3]>1) then write('BGR')
    else
    if (a[3]=0) and (a[1]>1) and (a[2]>1) then write('BGR');
end.

var
  f,a:array[1..3]of longint;
  n,i,tot,tt:longint; cc:char;
begin
  readln(n);
  for i:=1 to n do
    begin
      read(cc);
      case cc of
        'B':inc(a[1]);
        'G':inc(a[2]);
        'R':inc(a[3]);
      end;
    end;
  for i:=1 to 3 do
    if a[i]>2 then a[i]:=2;
  if (a[1]<>0)and(a[2]<>0)and(a[3]<>0) then
    begin f[1]:=1; f[2]:=1; f[3]:=1; end;
  tot:=0; tt:=0;
  for i:=1 to 3 do
    begin inc(tot,a[i]); if a[i]>0 then inc(tt); end;
  if (tot=4)and(tt=2) then
    begin f[1]:=1; f[2]:=1; f[3]:=1; end;
  if tt=1 then
    for i:=1 to 3 do
      if a[i]>0 then f[i]:=1;
  if tt=2 then
    begin
      if tot=2 then
        for i:=1 to 3 do
          if a[i]=0 then f[i]:=1;
      if tot=3 then
        for i:=1 to 3 do
          if a[i]<>2 then f[i]:=1;
    end;
  if f[1]=1 then write('B');
  if f[2]=1 then write('G');
  if f[3]=1 then write('R'); writeln;
end.

var
s:string;
n,b,r,g:longint;
bb,rr,gg:boolean;
procedure find( b,g,r:longint);
var
s:longint;
begin
s:=b+r+g;
if s=1 then
        begin
        if b=1 then bb:=true else
        if g=1 then gg:=true else
        rr:=true;
        end;
if s=2 then
        begin
        if b=2 then bb:=true else
        if r=2 then rr:=true else
        if g=2 then gg:=true else
        if b=0 then bb:=true else
        if g=0 then gg:=true else
        rr:=true;
        end
else
        begin
        if b>1 then find(b-1,g,r);
        if g>1 then find(b,g-1,r);
        if r>1 then find(b,g,r-1);
        if (b>0) and (g>0) then find(b-1,g-1,r+1);
        if (b>0) and (r>0) then find(b-1,g+1,r-1);
        if (r>0) and (g>0) then find(b+1,g-1,r-1);
        end;
end;

var
i:longint;
begin
bb:=false;
gg:=false;
rr:=false;
readln(n);
readln(s);
b:=0;
r:=0;
g:=0;
for i:=1 to n do
begin
if s[i]='B' then inc(b) else
if s[i]='G' then inc(g) else
inc(r);
end;
        if (b=0) and (g=0) then  begin writeln('R'); halt(0);  end;
        if (r=0) and (g=0) then  begin writeln('B'); halt(0);  end;
        if (b=0) and (r=0) then  begin writeln('G'); halt(0);  end;
        if n>20 then
                begin
                if (b*g=0) and (b+g=1)  then writeln('BG') else
                if (b*r=0) and (b+r=1) then writeln('BR') else
                if (r*g=0) and (r+g=1) then writeln('GR') else
                writeln('BGR');

                halt(0);
                end;
find(b,g,r);
if bb then write('B');
if gg then write('G');
if rr then write('R');
end.

var bb,gg,rr,b,g,r:longint;
n,i:longint;
s:ansistring;
begin
bb:=0;
rr:=0;
gg:=0;
readln(n);
readln(s);
if n=1 then begin write(s); halt; end;
for i:=1 to n do
case s[i] of
'B':inc(bb);
'R':inc(rr);
'G':inc(gg);
end;

if bb>0 then b:=1 else b:=0;
g:=gg;
r:=rr;
if((g>0)and(r>0))or(((g=0)or(r=0))and(b>0)and(g+r>b))or((g=0)and(r=0))then write('B');

if gg>0 then g:=1 else g:=0;
b:=bb;
r:=rr;
if((b>0)and(r>0))or(((r=0)or(b=0))and(g>0)and(r+b>g))or((b=0)and(r=0))then write('G');

if rr>0 then r:=1 else r:=0;
b:=bb;
g:=gg;
if((g>0)and(b>0))or(((g=0)or(b=0))and(r>0)and(g+b>r))or((g=0)and(b=0))then write('R');

end.

  var N : LongInt;
       i : LongInt;
       c : Char;
       Red , Green , Blue : LongInt;
begin
  readLn ( N ) ;

  for i := 1 to N do
  begin
    read ( c ) ;

    if ( c = 'R' ) then
      inc ( red ) ;
    if ( c = 'G' ) then
      inc ( green ) ;
    if ( c = 'B' ) then
      inc ( blue ) ;

  end;

  if ( Blue > 0 ) and ( Red > 0 ) and ( Green > 0 ) then
  begin
    writeLn ( 'BGR' ) ;
    halt();
  end;

  if ( Blue + Red = 0 ) then
  begin
    writeLn ( 'G' ) ;
    halt();
  end;

  if ( Red + Green = 0 ) then
  begin
    writeLn ( 'B' ) ;
    halt();
  end;

  if ( Green + Blue = 0 ) then
  begin
    writeLn ( 'R' ) ;
    halt();
  end;

  if ( Blue = 0 ) then
  begin

    if ( red + green = 2 ) then
      writeLn ( 'B' ) ;

    if ( red > 1 ) and ( green > 1 ) then
      writeLn ( 'BGR' );

    if ( red > 1 ) and ( green = 1 ) then
      writeLn ( 'BG' ) ;
    if ( red = 1 ) and ( green > 1) then
      writeLn ( 'BR' ) ;

  end;

  if ( Red = 0 ) then
  begin
    if ( Blue + Green = 2 ) then
      writeLn ( 'R' ) ;
    if ( Blue > 1 ) and ( Green > 1 ) then
      writeLn ( 'BGR' ) ;
    if ( Blue = 1 ) and ( Green > 1 ) then
      writeLn ( 'BR' ) ;
    if ( Blue > 1 ) and ( Green = 1 ) then
      writeLn ( 'GR' ) ;
  end;

  if ( Green = 0 ) then
  begin
    if ( Blue + Red = 2 ) then
      writeLn ( 'G' ) ;
    if ( Blue > 1 ) and ( Red > 1 ) then
      writeLn ( 'BGR' ) ;
    if ( Blue = 1 ) and ( Red > 1 ) then
      writeLn ( 'BG' ) ;
    if ( Blue > 1 ) and ( Red = 1 ) then
      writeLn ( 'GR' ) ;
  end;

end.

var
a,b,c,n,i,q:longint;
s:string;
begin
readln(N);
readln(s);
for i:=1 to n do begin
if s[i]='B'
then inc(A);
if s[i]='G'
then inc(b);
if s[i]='R'
then inc(c);
end;
if a>1
then inc(Q);
if b>1
then inc(Q);
if c>1
then inc(Q);
if (Q>1) or ((a>0) and (b>0) and (c>0))
then begin writeln('BGR'); halt; end;
if q=0
then begin
if a+b+c=2
then begin
if a=0
then writeln('B');
if b=0
then writeln('G');
if c=0
then writeln('R');
end;
if a+b+c=1
then begin
if a=1
then writeln('B');
if b=1
then writeln('G');
if c=1
then writeln('R');
end;
end;
if ((a+b+c=a) or (a+b+c=b) or (a+b+c=c)) and (Q=1)
then begin
if a+b+c=a
then writeln('B');
if a+b+c=b
then writeln('G');
if a+b+c=c
then writeln('R');
halt;
end;
if q=1
then begin
if a>1
then writeln('GR');
if b>1
then writeln('BR');
if c>1
then writeln('BG');
end;
end.

var
  so: string;
  pr: boolean;

function prov(st: string): boolean;
var
  i, k: integer;
  s1: string[1];
begin
  k := 1;
  prov := true;
  s1 := copy(st, 1, 1);
  for i := 2 to length(st) do
    if s1 = copy(st, i, 1) then
      k := k + 1;
  if k = length(st) then
    prov := false
end;

function men1(st: string; a, b: integer): string;
var
  s1, s2: string[1];
  s: string[3];
  st1: string[205];
begin
  st1 := st;
  s := 'BGR';
  s1 := copy(st1, a, 1);
  s2 := copy(st1, b, 1);
  delete(st1, a, 1);
  delete(st1, b - 1, 1);
  delete(s, pos(s1, s), 1);
  delete(s, pos(s2, s), 1);
  st1 := s + st1;
  men1 := st1
end;

function men2(st: string; a, b: integer): string;
var
  s: string[1];
  st1: string[205];
begin
  st1 := st;
  s := copy(st1, a, 1);
  delete(st1, a, 1);
  delete(st1, b - 1, 1);
  st1 := s + st1;
  men2 := st1
end;

function meno(var st: string; a, b: integer): string;
var
  s1, s2: string[1];
  t: integer;
begin
  s1 := copy(st, a, 1);
  s2 := copy(st, b, 1);
  if a > b then
  begin
    t := a;
    a := b;
    b := t
  end;
  if s1 = s2 then
    meno := men2(st, a, b)
  else
    meno := men1(st, a, b)
end;

procedure men(st: string);
var
  i, j, a1, b1, c1, a2, b2, c2: integer;
  si, sa, sb, sc: string[205];
  pr1: boolean;
begin
pr1:=true;
if length(st)>50 then
  pr1 := prov(st);
  if (length(st) >= 2) and pr and pr1 then
  begin
    a1 := pos('B', st);
    sa := copy(st, a1 + 1, length(st));
    a2 := pos('B', sa) + a1;
    b1 := pos('G', st);
    sb := copy(st, b1 + 1, length(st));
    b2 := pos('G', sb) + b1;
    c1 := pos('R', st);
    sc := copy(st, c1 + 1, length(st));
    c2 := pos('R', sc) + c1;

    if ((a1 = 0) and (b1 <> 0) and (c1 <> 0)) then
      men(meno(st, b1, c1))
      else
    if ((b1 = 0)  and (a1 <> 0) and (c1 <> 0)) then
      men(meno(st, a1, c1))
        else
    if ((c1 = 0) and (b1 <> 0) and (a1 <> 0)) then
      men(meno(st, a1, b1))
          else
    if ((a1 <> 0) and (b1 <> 0) and (c1 <> 0)) then
    begin
      men(meno(st, a1, b1));
      men(meno(st, c1, b1));
      men(meno(st, a1, c1))
    end;

    if (a1 <> 0) and (a2 <> a1) then
      men(meno(st, a1, a2));
    if (b1 > 0) and (b2 > b1) then
      men(meno(st, b1, b2));
    if (c1 <> 0) and (c2 <> c1) then
      men(meno(st, c1, c2));
  end
  else
  if pos(st, so) = 0 then
    so := so + st
    else
  if (not pr1) then
    men(copy(st, 1, 1));
  if length(so) = 3 then
    pr := false;

end;

var
  n: integer;
  st: string[205];
  so1: string[3];
  a, b, c, i: integer;

begin
  Readln(n);
  Readln(st);

  a := 0;
  b := 0;
  c := 0;
  pr := true;
  if n>40 then
  begin
  for i := 1 to length(st) do
  begin
    if copy(st, i, 1) = 'B' then
      a := a + 1;
    if copy(st, i, 1) = 'G' then
      b := b + 1;
    if copy(st, i, 1) = 'R' then
      c := c + 1;
  end;
  st := '';
    if a <> 0 then
      if a  = 1 then
        st := st + 'B'
      else
        st := st + 'BB';
  if b <> 0 then
    if b  = 1 then
      st := st + 'G'
    else
      st := st + 'GG';
  if c <> 0 then
    if c  = 1 then
      st := st + 'R'
    else
      st := st + 'RR'
      end;
  men(st);
  so1 := '';

  if pos('B', so) <> 0 then
    so1 := 'B';
  if pos('G', so) <> 0 then
    so1 := so1 + 'G';
  if pos('R', so) <> 0 then
    so1 := so1 + 'R';

  Writeln(so1)
end.

var s:string;
    i,j,n,m,r,g,b:longint;
begin
readln(n);
readln(s);
r:=0; g:=0; b:=0;

for i:=1 to n do
begin
if s[i]='R' then inc(r);
if s[i]='G' then inc(g);
if s[i]='B' then inc(b);
end;

if (r>0) and(g=0) and(b=0) then begin writeln('R'); halt; end;
if (r=0) and(g>0) and(b=0) then begin writeln('G'); halt; end;
if (r=0) and(g=0) and(b>0) then begin writeln('B'); halt; end;

if (r=1) and(g=1) and(b=0) then begin writeln('B'); halt; end;
if (r=1) and(g=0) and(b=1) then begin writeln('G'); halt; end;
if (r=0) and(g=1) and(b=1) then begin writeln('R'); halt; end;

if (r>1) and(g=1) and(b=0) then begin writeln('BG'); halt; end;
if (r>1) and(g=0) and(b=1) then begin writeln('BG'); halt; end;

if (r=1) and(g>1) and(b=0) then begin writeln('BR'); halt; end;
if (r=1) and(g=0) and(b>1) then begin writelN('GR'); halt; end;

if (r=0) and(g>1) and(b=1) then begin writeln('BR'); halt; end;
if (r=0) and(g=1) and(b>1) then begin writeln('GR'); halt; end;

writeln('BGR');
end.

var n,r,b,g,i:longint;
st,ot:string;
begin
  readln(n);
  readln(st);
  for i:=1 to n do
    if st[i]='B' then b:=b+1
    else if st[i]='G' then g:=g+1
    else r:=r+1;
  if (r>0) and (g>0) and (b>0) then ot:='BGR'
  else if (r>0) and (g=0) and (b=0) then ot:='R'
  else if (r=0) and (g>0) and (b=0) then ot:='G'
  else if (r=0) and (g=0) and (b>0) then ot:='B'
  else if (r=1) and (b>1) and (g=0) then ot:='GR'
  else if (r>1) and (b=1) and (g=0) then ot:='BG'
  else if (r=1) and (b=1) and (g=0) then ot:='G'
  else if (r>1) and (b>1) and (g=0) then ot:='BGR'
  else if (r=0) and (b>1) and (g=1) then ot:='GR'
  else if (r=0) and (b=1) and (g>1) then ot:='BR'
  else if (r=0) and (b>1) and (g>1) then ot:='BGR'
  else if (r=0) and (b=1) and (g=1) then ot:='R'
  else if (r>1) and (b=0) and (g=1) then ot:='BG'
  else if (r>1) and (b=0) and (g>1) then ot:='BGR'
  else if (r=1) and (b=0) and (g>1) then ot:='BR'
  else if (r=1) and (b=0) and (g=1) then ot:='B';
  writeln(ot);
end.

var
n,r,g,i,b:longint;
st:string;
begin

 readln(n);
 readln(st);
 for i:=1 to n do
  begin
   if st[i]='R' then r:=r+1;
   if st[i]='G' then g:=g+1;
   if st[i]='B' then b:=b+1;
  end;
  if (b=1) and (g=1) and (r=0) then writeln('R')
  else
  if (b=1) and (g=0) and (r=1) then writeln('G')
  else
  if (b=0) and (g=1) and (r=1) then writeln('B')
  else
  if (b>1) and (g=1) and (r=0) then writeln('GR')
  else
  if (b>1) and(g=0) and (r=1) then writeln('GR')
  else
  if (b=1) and (g>1) and (r=0) then writeln('BR')
  else
  if (b=0) and (g>1) and (r=1) then writeln('BR')
  else
  if (b=1) and (g=0) and (r>1) then writeln('BG')
  else
  if (b=0) and (g=1) and (r>1) then writeln('BG')
  else
  if (b>0) and(g=0) and(r=0) then writeln('B')
  else
   if (b=0) and(g>0) and(r=0) then writeln('G')
  else
   if (b=0) and(g=0) and(r>0) then writeln('R')
  else writeln('BGR');

end.

var b,g,r,bs,gs,rs,i,j,n,k,m,s:longint;
    x:char;
    bb,gb,rb:integer;

begin
readln(n);
for i:=1 to n do
begin
 read(x);
 if x= 'R' then inc(rs) else
                         if x= 'B' then inc(bs)
                                    else inc(gs);
 end;

if gs>1 then gs:=2;
if bs>1 then bs:=2;
if rs>1 then rs:=2;
b:=bs; g:=gs; r:=rs;
if ((r>0) and (g>0)) or ((r=2) and (b>0)) or ((g=2) and (b>0)) or (r+g=0) then write('B');
if ((r>0) and (b>0)) or ((r=2) and (g>0)) or ((b=2) and (g>0)) or (r+b=0) then write('G');
if ((b>0) and (g>0)) or ((b=2) and (r>0)) or ((g=2) and (r>0)) or (b+g=0) then write('R');
end.

uses math;
var b,g,r,bs,gs,rs,i,j,n,k,m,s:longint;
    h:char;
    bb,gb,rb:boolean;

begin
    readln(n);
    for i:=1 to n do
    begin
        read(h);
        if h = 'R' then inc(rs) else
        if h = 'B' then inc(bs) else
                        inc(gs);
    end;

        if gs > 1 then gs:=2;
        if bs > 1 then bs:=2;
        if rs > 1 then rs:=2;

    b:=bs; g:=gs; r:=rs;

    if ((r>0) and (g>0)) or ((r=2) and (b>0)) or ((g=2) and (b>0)) or (r+g=0) then write('B');
    if ((r>0) and (b>0)) or ((r=2) and (g>0)) or ((b=2) and (g>0)) or (r+b=0) then write('G');
    if ((b>0) and (g>0)) or ((b=2) and (r>0)) or ((g=2) and (r>0)) or (b+g=0) then write('R');
    end.

var st:string;
n,i,r,g,b:longint;
begin
  readln(n);
  readln(st);
  if n=1 then begin
               writeln(st);
               halt;
              end;

  for i:=1 to n do
    if st[i]='R' then r:=r+1
                 else if st[i]='G' then g:=g+1
                 else b:=b+1;

  if ((r=1) and (g=1) and (b=0)) or
     ((r=0) and (g=0)) then begin
                             writeln('B');
                             halt;
                            end
                     else if ((b=1) and (g=1) and (r=0)) or
                             ((b=0) and (g=0)) then begin
                                                     writeln('R');
                                                     halt;
                                                    end
                     else if ((b=1) and (r=1) and (g=0)) or
                             ((b=0) and (r=0)) then begin
                                                     writeln('G');
                                                     halt;
                                                    end;

  if ((g=0) and (r>=2) and (b>=2)) or
     ((b=0) and (r>=2) and (g>=2)) or
     ((r=0) and (b>=2) and (g>=2)) or
     ((r>0) and (b>0) and (g>0)) then begin
                                       writeln('BGR');
                                       halt;
                                      end;
  if (g=1) and (r=0) and (b>1) then begin
                                     writeln('GR');
                                     halt;
                                    end;
  if (g=1) and (b=0) and (r>1) then begin
                                     writeln('BG');
                                     halt;
                                    end;
  if (r=1) and (g=0) and (b>1) then begin
                                     writeln('GR');
                                     halt;
                                    end;
  if (r=1) and (b=0) and (g>1) then begin
                                     writeln('BR');
                                     halt;
                                    end;
  if (b=1) and (g=0) and (r>1) then begin
                                     writeln('BG');
                                     halt;
                                    end;
  if (b=1) and (r=0) and (g>1) then begin
                                     writeln('BR');
                                     halt;
                                    end;
end.

var
  a, c, r, g, b, i: int64;
  ar: array [1..1000] of char;
  q1, q2, q3: boolean;

procedure rek(a, r, g, b: int64);
begin
  if a = 1 then begin
    if r = 1 then q1 := true;
    if g = 1 then q2 := true;
    if b = 1 then q3 := true;
    exit;
  end;
  if b > 1 then rek(a - 1, r, g, b - 1);
  if (b > 0) and (r > 0) then rek(a - 1, r - 1, g + 1, b - 1);
  if (b > 0) and (g > 0) then rek(a - 1, r + 1, b - 1, g - 1);
  if r > 1 then rek(a - 1, r - 1, g, b);
  if (r > 0) and (g > 0) then rek(a - 1, r - 1, g - 1, b + 1);
  if g > 1 then rek(a - 1, r, g - 1, b);
end;

begin
  readln(a);
  i := 1;
  while i <= a do begin
    read(ar[i]);
    if ar[i] = 'R' then inc(r);
    if ar[i] = 'G' then inc(g);
    if ar[i] = 'B' then inc(b);
    inc(i);
  end;
  if (r > 0) and (g > 0) and (b > 0) then begin
    q1 := true;
    q2 := true;
    q3 := true;
  end
  else if (r >= 2) and (g >= 2) then begin
    q1 := true;
    q2 := true;
    q3 := true;
  end
  else if (r >= 2) and (b >= 2) then begin
    q1 := true;
    q2 := true;
    q3 := true;
  end
  else if (g >= 2) and (b >= 2) then begin
    q1 := true;
    q2 := true;
    q3 := true;
  end
  else if (r = 1) and (g > 1) then begin
    q1 := true;
    q3 := true;
  end
  else if (r = 1) and (b > 1) then begin
    q1 := true;
    q2 := true;
  end
  else if (g = 1) and (r > 1) then begin
    q2 := true;
    q3 := true;
  end
  else if (g = 1) and (b > 1) then begin
    q2 := true;
    q1 := true;
  end
  else if (b = 1) and (r > 1) then begin
    q3 := true;
    q2 := true;
  end
  else if (b = 1) and (g > 1) then begin
    q3 := true;
    q1 := true;
  end
  else if (r = 1) and (g = 1) then q3 := true
  else if (r = 1) and (b = 1) then q2 := true
  else if (g = 1) and (b = 1) then q1 := true
  else if (r > 0) then q1 := true
  else if (g > 0) then q2 := true
  else if (b > 0) then q3 := true;
  if q3 then write('B');
  if q2 then write('G');
  if q1 then write('R');
end.

var i,n,j,x,y,t,kol,R,B,G:longint;
s,sn:string;
begin
readln(n);
readln(s);
for i:=1 to length(s) do
begin
if (s[i]='R') then inc(r);
if (s[i]='B') then inc(b);
if (s[i]='G') then inc(g);
end;

if (R>0)and(B>0)and(g>0) then
begin
writeln('BGR');
halt;
end;

if ((r>1)and(b>1))or
   ((r>1)and(g>1))or
   ((g>1)and(b>1)) then
begin
writeln('BGR');
halt;
end;

if (r>1)and(b=1) then writeln('BG') else
if (r=1)and(b>1) then writeln('GR') else
if (r=1)and(b=1) then writeln('G') else

if (r>1)and(g=1) then writeln('BG') else
if (r=1)and(g>1) then writeln('BR') else
if (r=1)and(g=1) then writeln('B') else

if (g>1)and(b=1) then writeln('BR') else
if (g=1)and(b>1) then writeln('GR') else
if (g=1)and(b=1) then writeln('R') else
if (g>0) then writelN('G') else
if (b>0) then writeln('B') else
if (r>0) then writeln('R');

end.

var i,n,r,g,b:longint;
    c:char;
begin
readln(n);
for i:=1 to n do
   begin
   read(c);
   case c of
   'R':inc(r);
   'G':inc(g);
   'B':inc(b);
   end end;
if ((r>0)and(g>0)and(b>0))or((r>1)and(g>1)or(r>1)and(b>1)or(b>1)and(g>1))then write('BGR') else
   if (r=0)and(g=0) then write('B') else
   if (r=0)and(b=0) then write('G') else
   if (g=0)and(b=0) then write('R') else
   if (r>1) then write('BG') else
   if (g>1) then write('BR') else
   if (b>1) then write('GR') else
   if n=2 then if g=0 then write('G') else if b=0 then write('B') else write('R');
end.

var r, g, b, n, i, j, t:longint;
s:string;
a:array[1..3] of longint;
begin
  readln(n);
  read(s);
  r := 0; b := 0; g := 0;
  for i := 1 to n do begin
    if s[i] = 'R' then r := r + 1;
    if s[i] = 'G' then g := g + 1;
    if s[i] = 'B' then b := b + 1;
  end;
  if r > 3 then r := 2;
  if g > 3 then g := 2;
  if b > 3 then b := 2;
  a[1] := r; a[2] := g; a[3] := b;
  for i := 1 to 3 do for j := 1 to 3 do if (a[i] < a[j]) and (i > j) then begin t := a[i]; a[i] := a[j]; a[j] := t; end;
  //writeln(a[1], ' ', a[2], ' ', a[3]);
  if a[1] > 0 then begin
    writeln('BGR');
    exit;
  end;
  if (a[1] = 0) and (a[2] = 2) then begin
    writeln('BGR');
    exit;
  end;
  if (a[1] = 0) and (a[2] = 1) and (a[3] = 2) then begin
    if (b = 1) or (b = 0) then write('B'); if (g = 1) or (g = 0) then write('G'); if (r = 1) or (r = 0) then write('R');
    exit;
  end;
  if (a[1] = 0) and (a[2] = 1) and (a[3] = 1) then begin
    if (b = 0) then write('B'); if (g = 0) then write('G'); if (r = 0) then write('R');
    exit;
  end;
  if (a[1] = 0) and (a[2] = 0) and (a[3] > 0) then begin
    if b > 0 then write('B'); if g > 0 then write('G'); if r > 0 then write('R');
    exit;
  end;
end.

var st,ans:string;
i,n,r,g,b:longint;
begin
  readln(n);
  readln(st);
  for i:=1 to n do
    if st[i]='R' then r:=r+1
      else if st[i]='G' then g:=g+1
        else b:=b+1;

  if (r=0) and (g=0) then ans:='B'
   else
    if (r=0) and (b=0) then ans:='G'
      else
      if (b=0) and (g=0) then ans:='R'
      else
      if (r=0) and (g=1) and (b=1) then ans:='R'
      else
      if (r=0) and (g>1) and (b=1) then ans:='BR'
      else
      if (r=0) and (g=1) and (b>1) then ans:='GR'

      else
      if (b=0) and (g=1) and (r=1) then ans:='B'
      else
      if (b=0) and (g>1) and (r=1) then ans:='BR'
      else
      if (b=0) and (g=1) and (r>1) then ans:='BG'

      else
      if (g=0) and (b=1) and (r=1) then ans:='G'
      else
      if (g=0) and (b>1) and (r=1) then ans:='GR'
      else
      if (g=0) and (b=1) and (r>1) then ans:='BG'
      else ans:='BGR';
   writeln(ans);
end.

var n,i,kG,kB,Kr:longint;
    s:string;
procedure ex(h:string);
begin
write(h);

halt;
end;
begin

readln(n);
read(s);
for i:=1 to n do begin
if s[i]='G' then inc(kG);
if s[i]='R' then inc(kR);
if s[i]='B' then inc(kB);
end;
if (kG=0) and (kR=0) then ex('B');
if (kG=0) and (kB=0) then ex('R');
if (kB=0) and (kR=0) then ex('G');

if (kG>0) and (kB>0) and (kR>0) then ex('BGR');
if KG=0 then begin
 if (kB-1>0) and (kR-1>0) then ex('BGR');
 if (kB-1=0) and (kR-1>0) then ex('BG');
 if (kB-1=0) and (kR-1=0) then ex('G');
 if (kB-1>0) and (kr-1=0) then ex('GR');
end;
if Kb=0 then begin
 if (kG-1>0) and (kR-1>0) then ex('BGR');
 if (kG-1=0) and (kR-1>0) then ex('BG');
 if (kG-1=0) and (kR-1=0) then ex('B');
 if (kG-1>0) and (kr-1=0) then ex('BR');
end;
if Kr=0 then begin
 if (kB-1>0) and (kG-1>0) then ex('BGR');
 if (kB-1=0) and (kG-1>0) then ex('BR');
 if (kB-1=0) and (kG-1=0) then ex('R');
 if (kB-1>0) and (kG-1=0) then ex('GR');
end;
end.

const
    fi ='';
    fg ='';
var n:longint;
    s:ansistring;
    sum:array[1..3] of longint;
    g:text;
procedure nhap;
var f:text;
begin
    assign(f,fi);
    reset(f);
    readln(f,n);
    readln(f,s);
    close(f);
end;
procedure xuly3;
begin
    If ((sum[3] = 0) and ((sum[2] = 0) or (sum[1] = 0))) or ((sum[3] > 0) and (((sum[2] = 1) and (sum[1] = 0)) or ((sum[1] = 1) and (sum[2] = 0)))) then exit;
    write(g,'R');
end;
procedure xuly2;
begin
    If ((sum[2] = 0) and ((sum[1] = 0) or (sum[3] = 0))) or ((sum[2] > 0) and (((sum[1] = 1) and (sum[3] = 0)) or ((sum[3] = 1) and (sum[1] = 0)))) then exit;
    write(g,'G');
end;
procedure xuly1;
begin
    If ((sum[1] = 0) and ((sum[2] = 0) or (sum[3] = 0))) or ((sum[1] > 0) and (((sum[2] = 1) and (sum[3] = 0)) or ((sum[3] = 1) and (sum[2] = 0)))) then exit;
    write(g,'B');
end;
procedure xuly;
var i:longint;
begin
    assign(g,fg);
    rewrite(g);
    For i:=1 to 3 do sum[i] :=0;
    For i:=1 to n do
    begin
        case s[i] of
            'B':inc(sum[1]);
            'G':inc(sum[2]);
            'R':inc(sum[3]);
        end;
    end;
    xuly1;xuly2;xuly3;
    close(g);
end;
begin
    nhap;
    xuly;
end.

var
 k1,k2,k3,i,j,n,m,k,t,x:longint;
 f:array[0..222,0..222,0..222]of boolean;
 s:ansistring;

procedure dfs(k1,k2,k3:longint);
begin
 if f[k1,k2,k3]then exit;
 f[k1,k2,k3]:=true;
 if k1>1 then dfs(k1-1,k2,k3);
 if k2>1 then dfs(k1,k2-1,k3);
 if k3>1 then dfs(k1,k2,k3-1);
 if(k1>0)and(k2>0)then dfs(k1-1,k2-1,k3+1);
 if(k1>0)and(k3>0)then dfs(k1-1,k2+1,k3-1);
 if(k2>0)and(k3>0)then dfs(k1+1,k2-1,k3-1);
end;

begin
 readln(n);
 readln(s);
 for i:=1 to n do
 begin
  if s[i]='R' then inc(k1);
  if s[i]='G' then inc(k2);
  if s[i]='B' then inc(k3);
 end;
 dfs(k1,k2,k3);
 if f[0,0,1]then write('B');
 if f[0,1,0]then write('G');
 if f[1,0,0]then write('R');
 writeln;
end.

var a:array[0..2,0..2,0..2]of boolean;
    sb,sg,sr,i,j,k,n:longint;
    ch:char;
procedure search(sb,sg,sr:longint);
begin
 if a[sb,sg,sr] then exit;
 a[sb,sg,sr]:=true;
 if (sb>=1)and(sg>=1) then search(sb-1,sg-1,sr+1);
 if (sb>=1)and(sr>=1) then search(sb-1,sg+1,sr-1);
 if (sr>=1)and(sg>=1) then search(sb+1,sg-1,sr-1);
 if sb>=2 then search(sb-1,sg,sr);
 if sg>=2 then search(sb,sg-1,sr);
 if sr>=2 then search(sb,sg,sr-1);
end;
begin
 readln(n);
 sb:=0;
 sg:=0;
 sr:=0;
 for i:=1 to n do
  begin
   read(ch);
   if ch='B' then inc(sb);
   if ch='G' then inc(sg);
   if ch='R' then inc(sr);
  end;
 if sb>=2 then sb:=2;
 if sg>=2 then sg:=2;
 if sr>=2 then sr:=2;
 for i:=0 to 2 do
  for j:=0 to 2 do
   for k:=0 to 2 do
    a[i,j,k]:=false;
 search(sb,sg,sr);
 if a[1,0,0] then write('B');
 if a[0,1,0] then write('G');
 if a[0,0,1] then write('R');
end.

var s:string;
    i,n:longint;
    a:array[1..3]of longint;
begin
 readln(n);
 read(s);
 for i:=1 to length(s) do
  begin
   if s[i]='B'
    then inc(a[1]);
   if s[i]='G'
    then inc(a[2]);
   if s[i]='R'
    then inc(a[3]);
  end;
 if (a[1]>0)and(a[2]>0)and(a[3]>0)
  then begin write('BGR');halt;end;

 if (a[1]=0)and(a[2]=0)and(a[3]>0)
  then begin write('R');halt;end;
 if (a[1]>0)and(a[2]=0)and(a[3]=0)
  then begin write('B');halt;end;
  if (a[1]=0)and(a[2]>0)and(a[3]=0)
  then begin write('G');halt;end;

 if (a[1]=0)and(a[2]=1)and(a[3]=1)
  then begin write('B');halt;end;
 if (a[1]=1)and(a[2]=0)and(a[3]=1)
  then begin write('G');halt;end;
 if (a[1]=1)and(a[2]=1)and(a[3]=0)
  then begin write('R');halt;end;

 if (a[1]>1)and(a[2]<=1)and(a[3]<=1)
  then begin write('GR');halt;end;
 if (a[1]<=1)and(a[2]>1)and(a[3]<=1)
  then begin write('BR');halt;end;
 if (a[1]<=1)and(a[2]<=1)and(a[3]>1)
  then begin write('BG');halt;end;
 write('BGR');

end.

uses math;
const
        maxc=1000000000+69;
        modulo=1000000000+7;

type
        re=record
                x,y:longint;
        end;

var
        c:array['A'..'Z'] of longint;
        dem:array[1..3] of longint;
        ch:array[1..3] of char;
        n,cnt:longint;
        s:string;

procedure mofile;
begin
        assign(input,'');
        reset(input);
        assign(output,'');
        rewrite(output);
end;

procedure dongfile;
begin
        close(input);
        close(output);
end;

procedure xuli;
var
        i,k:longint;
        j:char;
begin
        readln(n);
        readln(s);
        c['B']:=1;
        c['G']:=2;
        c['R']:=3;
        ch[1]:='B';
        ch[2]:='G';
        ch[3]:='R';
        for i:=1 to n do inc(dem[c[s[i]]]);
        for i:=1 to 3 do cnt:=cnt+ord(dem[i]>0);
        if cnt=3 then writeln('BGR') else
        begin
                if cnt=1 then
                begin
                        for i:=1 to 3 do
                        if dem[i]>0 then
                        begin
                                writeln(ch[i]);
                        end;
                end
                else
                begin
                        if (dem[1]+dem[2]+dem[3]=2) then
                        begin
                                for i:=1 to 3 do
                                if dem[i]=0 then writeln(ch[i]);
                        end
                        else
                        begin
                                for i:=1 to 3 do
                                if dem[i]=1 then
                                begin
                                        for k:=1 to 3 do
                                        if dem[k]<=1 then write(ch[k]);
                                        writeln;
                                        halt;
                                end;
                                writeln('BGR');
                        end
                end;
        end;
end;

begin
        mofile;
        xuli;
        dongfile;
end.

program z1;
var s,res:ansistring;
n,a,b,c,i,k:longint;
begin
readln(n);
readln(s);
for i:=1 to n do begin
                 if s[i]='B' then inc(a);
                 if s[i]='G' then inc(b);
                 if s[i]='R' then inc(c);
                 if ((a>0) and (b>0) and (c>0)) or ((a>1) and (b>1)) or ((a>1) and (c>1)) or ((b>1) and (c>1)) then begin
                                                   write('BGR');
                                                   halt
                                                   end
                 end;
if (a=0) and (b=0) then begin
                        write('R');
                        halt
                        end;
if (a=0) and (c=0) then begin
                        write('G');
                        halt
                        end;
if (c=0) and (b=0) then begin
                        write('B');
                        halt
                        end;
if (a=1) and (b=1) then begin
                        write('R');
                        halt
                        end;
if (a=1) and (c=1) then begin
                        write('G');
                        halt
                        end;
if (c=1) and (b=1) then begin
                        write('B');
                        halt
                        end;
if a=1 then begin
            if b<>0 then write('BR')
                    else write('BG');
            halt
            end;
if b=1 then begin
            if c<>0 then write('BG')
                    else write('GR');
            halt
            end;
if c=1 then begin
            if b<>0 then write('BR')
                    else write('GR');
            halt
            end;
End.

Program Buntarik;
var n,a,b,c,i:longint;
s:string;
begin
{assign(input,'input.txt');
reset(input);
assign(output,'output.txt');
rewrite(output); }

readln(n);
readln(s);
for i:=1 to n do
if s[i]='B'
then inc(a)
else if s[i]='R'
then inc(b)
else inc(c);
if n=1
then begin writeln(s); halt; end;

if (a>0)and(b>0)and(c>0)or(a>1)and(b>1)or(c>1)and(b>1)or(a>1)and(c>1)
then writeln('BGR')
else
if (a>1)and(b=1)and(c=0)or(a>1)and(b=0)and(c=1)
then writeln('GR')
else
if (a=1)and(b>1)and(c=0)or(a=0)and(b>1)and(c=1)
then writeln('BG')
else
if (a=1)and(b=0)and(c>1)or(a=0)and(b=1)and(c>1)
then writeln('BR')
else if (a>1)and(b=0)and(c=0)or(a=0)and(b=1)and(c=1)
then writeln('B')
else if (a=0)and(b>1)and(c=0)or(a=1)and(b=0)and(c=1)
then writeln('R')
else if (a=0)and(b=0)and(c>1)or(a=1)and(b=1)and(c=0)
then writeln('G');

{close(input);
close(output);}
end.

var
        s:string;
        n,i:longint;
        R,G,B:longint;

begin
        readln(n);
        readln(s);
        for i:=1 to n do
        begin
                if s[i]='B' then inc(B);
                if s[i]='G' then inc(G);
                if s[i]='R' then inc(R);
        end;
        if   (B>=1) and (G>=1) and (R>=1) then writeln('BGR')
        else begin
                if (B=0) and (G>0) and (R>0)  then
                begin
                        if (G>=2) and (R>=2) then writeln('BGR');
                        if (G=1) and (R>=2) then writeln('BG');
                        if (G>=2) and (R=1) then writeln('BR');
                        if (G=1) and (R=1) then writeln('B');
                end;
                if (G=0) and (B>0) and (R>0) then
                begin
                        if (B>=2) and (R>=2) then writeln('BGR');
                        if (B=1) and (R>=2) then writeln('BG');
                        if (R=1) and (B>=2) then writeln('GR');
                        if (B=1) and (R=1) then writeln('G');
                end;
                if (R=0) and (B>0) and (G>0) then
                begin
                        if (B>=2) and (G>=2) then writeln('BGR');
                        if (B=1) and (G>=2) then writeln('BR');
                        if (G=1) and (B>=2) then writeln('GR');
                        if (G=1) and (B=1) then writeln('R');
                end;
                if (B=0) and (G=0) then writeln('R');
                if (B=0) and (R=0) then writeln('G');
                if (G=0) and (R=0) then writeln('B');
             end;
end.

var
 N,i,B,R,G:longint;
 ch:char;
 fg,fr,fb:boolean;

procedure G1(b,r,g:byte);
begin
 if(b=0)and(r=0) then fg:=true;
 if(b=0)and(g=0) then fr:=true;
 if(g=0)and(r=0) then fb:=true;

 if(b+g+r>1) then begin
  if(b>0)and(g>0) then G1(b-1,r+1,g-1);
  if(b>0)and(r>0) then G1(b-1,r-1,g+1);
  if(r>0)and(g>0) then G1(b+1,r-1,g-1);
  if(b>1) then G1(b-1,r,g);
  if(r>1) then G1(b,r-1,g);
  if(g>1) then G1(b,r,g-1);
 end;
end;

begin
 readln(n);
 b:=0;
 r:=0;
 g:=0;

 for i:=1 to N do begin
  read(ch);
  if(ch='B') then inc(b);
  if(ch='R') then inc(r);
  if(ch='G') then inc(g);
 end;

 if(b>4) then b:=4;
 if(r>4) then r:=4;
 if(g>4) then g:=4;

 fg:=false;
 fr:=false;
 fb:=false;

 G1(b,r,g);

 if(fb) then write('B');
 if(fg) then write('G');
 if(fr) then write('R');
end.

var
  s : ansistring;
  n,r,b,g,i : longint;

  function chk(x,y,z : longint) : boolean;
    begin
      if (x > 0) and (y > 0) and (z > 0) then exit(true);
      if (y+z = 0) then exit(true);
      if (x = 0) then begin
        if (y > 0) and (z > 0) then exit(true);
      end;
      if (y = 0) then begin
        if (x > 0) and (z > 1) then exit(true);
      end;
      if (z = 0) then begin
        if (x > 0) and (y > 1) then exit(true);
      end;
      exit(false);
    end;

begin
  readln(n);
  readln(s);
  for i:=1 to n do begin
    if s[i] = 'R' then inc(r);
    if s[i] = 'G' then inc(g);
    if s[i] = 'B' then inc(b);
  end;
  if chk(b,r,g) then write('B');
  if chk(g,r,b) then write('G');
  if chk(r,g,b) then write('R');
  writeln;
end.

{$mode objfpc}
CONST
    ip              = '';//'card.inp';
    op              = '';//'card.out';
VAR
    n               : LongInt;
    b,g,r           : LongInt;
    s,t             : String;

procedure INPUT;
var
    f               : Text;
begin
    assign(f,ip); reset(f);
    readln(f,n);
    readln(f,s);
    close(f);
end;

function check(a,b,c : LongInt) :BooLean;
begin
    if (a >= 1) and (b < 1) and (c < 1) then exit(true);
    if (a >= 1) and ((b >1) or (c > 1)) then exit(true);
    if (b >= 1) and  (c >= 1) then exit(true);

    exit(false);
end;

procedure SOLVE;
var
    i,j             : Longint;
begin
    for i := 1 to n do
        case s[i] of
            'B' : inc(b);
            'G' : inc(g);
            'R' : inc(r);
        end;
end;

procedure OUTPUT;
var
    f           : Text;
    i           : LongInt;
begin
    assign(f,op); rewrite(f);
    if check(b,g,r) then write(f,'B');
    if check(g,b,r) then write(f,'G');
    if check(r,b,g) then write(f,'R');
    close(f);
end;

BEGIN
    INPUT;
    SOLVE;
    OUTPUT;
END.

var
    n, i, g, b, r: Integer;
    s: string;

begin
    ReadLn (n);
    ReadLn (s);

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

    for i:= 1 to Length (s) do
        if s[i] = 'G' then
            Inc (g)
        else if s[i] = 'B' then
            Inc (b)
        else if s[i] = 'R' then
            Inc (r);

    if (b = 0) and ((r = 0) or (g = 0)) then
    else if (b >= 1) and (r + g = 1) then
    else Write ('B');

    if (g = 0) and ((r = 0) or (b = 0)) then
    else if (g >= 1) and (r + b = 1) then
    else Write ('G');

    if (r = 0) and ((b = 0) or (g = 0)) then
    else if (r >= 1) and (b + g = 1) then
    else Write ('R')
end.

Program p1;
var n, i, j, l:longint;
    c:array [1..200] of char;
    a:array [1..200,1..3] of byte;
begin
  readln (n);
  for i:=1 to n do
    read (c[i]);
  fillchar (a,(n+1)*4,0);
  if n=1 then
    begin
      write (c[1]);
      halt;
    end;
  if c[1]='R' then
    if c[2]='R' then
      begin
        a[1,1]:=1;
        a[2,1]:=1;
      end
    else if c[2]='B' then
      begin
        a[1,1]:=1;
        a[2,3]:=1;
      end
    else
      begin
        a[1,1]:=1;
        a[2,2]:=1;
      end
  else if c[1]='B' then
    if c[2]='R' then
      begin
        a[1,2]:=1;
        a[2,3]:=1;
      end
    else if c[2]='B' then
      begin
        a[1,2]:=1;
        a[2,2]:=1;
      end
    else
      begin
        a[1,2]:=1;
        a[2,1]:=1;
      end
  else if c[2]='R' then
    begin
      a[1,3]:=1;
      a[2,2]:=1;
    end
  else if c[2]='B' then
    begin
      a[1,3]:=1;
      a[2,1]:=1;
    end
  else
    begin
      a[1,3]:=1;
      a[2,3]:=1;
    end;
  for i:=3 to n do
    begin
      if c[i]='R' then
        for j:=1 to 3 do
          begin
            if a[i-1,j]=1 then
              if j=1 then a[i,1]:=1
              else if j=2 then a[i,3]:=1
              else a[i,2]:=1;
            if a[i-2,j]=1 then
              if c[i-1]='R' then
                if j=1 then a[i,1]:=1
                else if j=2 then a[i,3]:=1
                else a[i,2]:=1
              else if c[i-1]='B' then
                if j=1 then a[i,2]:=1
                else if j=2 then a[i,1]:=1
                else a[i,3]:=1
              else if j=1 then a[i,3]:=1
              else if j=2 then a[i,2]:=1
              else a[i,1]:=1;
            if a[i-2,j]=1 then
              if c[i-1]='R' then
                if j=1 then a[i,1]:=1
                else if j=2 then a[i,2]:=1
                else a[i,3]:=1
              else if c[i-1]='B' then
                if j=1 then a[i,3]:=1
                else if j=2 then a[i,1]:=1
                else a[i,2]:=1
              else if j=1 then a[i,2]:=1
              else if j=2 then a[i,3]:=1
              else a[i,1]:=1;
          end
      else if c[i]='B' then
        for j:=1 to 3 do
          begin
            if a[i-1,j]=1 then
              if j=1 then a[i,3]:=1
              else if j=2 then a[i,2]:=1
              else a[i,1]:=1;
            if a[i-2,j]=1 then
              if c[i-1]='R' then
                if j=1 then a[i,2]:=1
                else if j=2 then a[i,1]:=1
                else a[i,3]:=1
              else if c[i-1]='B' then
                if j=1 then a[i,3]:=1
                else if j=2 then a[i,2]:=1
                else a[i,1]:=1
              else if j=1 then a[i,1]:=1
              else if j=2 then a[i,3]:=1
              else a[i,2]:=1;
            if a[i-2,j]=1 then
              if c[i-1]='R' then
                if j=1 then a[i,2]:=1
                else if j=2 then a[i,3]:=1
                else a[i,1]:=1
              else if c[i-1]='B' then
                if j=1 then a[i,1]:=1
                else if j=2 then a[i,2]:=1
                else a[i,3]:=1
              else if j=1 then a[i,3]:=1
              else if j=2 then a[i,1]:=1
              else a[i,2]:=1;
          end
      else
        for j:=1 to 3 do
          begin
            if a[i-1,j]=1 then
              if j=1 then a[i,2]:=1
              else if j=2 then a[i,1]:=1
              else a[i,3]:=1;
            if a[i-2,j]=1 then
              if c[i-1]='R' then
                if j=1 then a[i,3]:=1
                else if j=2 then a[i,2]:=1
                else a[i,1]:=1
              else if c[i-1]='B' then
                if j=1 then a[i,1]:=1
                else if j=2 then a[i,3]:=1
                else a[i,2]:=1
              else if j=1 then a[i,2]:=1
              else if j=2 then a[i,1]:=1
              else a[i,3]:=1;
            if a[i-2,j]=1 then
              if c[i-1]='R' then
                if j=1 then a[i,3]:=1
                else if j=2 then a[i,1]:=1
                else a[i,2]:=1
              else if c[i-1]='B' then
                if j=1 then a[i,2]:=1
                else if j=2 then a[i,3]:=1
                else a[i,1]:=1
              else if j=1 then a[i,1]:=1
              else if j=2 then a[i,2]:=1
              else a[i,3]:=1;
          end;
    end;
  if a[n,2]=1 then write ('B');
  if a[n,3]=1 then write ('G');
  if a[n,1]=1 then write ('R');
end.

uses math;
var
 a,t1,t2,t3,r:array[0..100000]of longint;
 s,ss:ansistring;
 i,m,n,k,l,w,j,p1,p2,p3:longint;
begin
 readln(n);
 readln(s);
 for i:=1 to n do
 begin
  if s[i]='B' then inc(a[1]);
  if s[i]='G' then inc(a[2]);
  if s[i]='R' then inc(a[3]);
 end;

 if (a[1]<>0) then
 begin
  if a[2]+a[3]<>1 then r[1]:=1;
 end;
 if a[1]=0 then
 begin
  if (a[2]<>0)and(a[3]<>0) then r[1]:=1;
 end;

 if (a[2]<>0) then
 begin
  if a[1]+a[3]<>1 then r[2]:=1;
 end;
 if a[2]=0 then
 begin
  if (a[1]<>0)and(a[3]<>0) then r[2]:=1;
 end;

 if (a[3]<>0) then
 begin
  if (a[1]+a[2]<>1) then r[3]:=1;
 end;
 if a[3]=0 then
 begin
  if (a[2]<>0)and(a[1]<>0) then r[3]:=1;
 end;
 if r[1]=1 then write('B');
 if r[2]=1 then write('G');
 if r[3]=1 then write('R');
end.

var
     N,i:Longint;
     X:Char;
     cnt,ans:array ['A'..'Z'] of Longint;
procedure DFS(B,G,R:Longint);
begin
     if B+G+R=1 then begin
                          if B=1 then ans['B']:=1;
                          if G=1 then ans['G']:=1;
                          if R=1 then ans['R']:=1;
                          Exit;
                      end;
     if B>1 then DFS((B div 2)+(B mod 2),G,R);
     if G>1 then DFS(B,(G div 2)+(G mod 2),R);
     if R>1 then DFS(B,G,(R div 2)+(R mod 2));
     if (B>0) and (G>0) then DFS(B-1,G-1,R+1);
     if (B>0) and (R>0) then DFS(B-1,G+1,R-1);
     if (G>0) and (R>0) then DFS(B+1,G-1,R-1);
 end;

begin
     Readln(N);
     for i:=1 to N do
begin
     Read(X);
     Inc(cnt[X]);
 end;
     while cnt['G']>2 do
     cnt['G']:=(cnt['G'] div 2)+(cnt['G'] mod 2);
     while cnt['B']>2 do
     cnt['B']:=(cnt['B'] div 2)+(cnt['B'] mod 2);
     while cnt['R']>2 do
     cnt['R']:=(cnt['R'] div 2)+(cnt['R'] mod 2);
     DFS(cnt['B'],cnt['G'],cnt['R']);
     if ans['B']=1 then Write('B');
     if ans['G']=1 then Write('G');
     if ans['R']=1 then Write('R');
 end.

var a:array[0..2001]of int64;
    s:array[0..2001] of char;
    pr,ind1,ind2,ind3,n,i:longint;
begin
readln(n);
pr:=0;
for i:=1 to n do
begin
read(s[i]);
if s[i]='B'then inc(a[1])else
if s[i]='G'then inc(a[2])else
inc(a[3]);
end;
for i:=1 to 3 do
if a[i]<>0 then inc(pr);

if pr=3 then begin writeln('BGR');halt;end;
if pr=1 then
             for i:=1 to 3 do
               if a[i]<>0 then
               if i=1 then  begin writeln('B');halt;end else
               if i=2 then  begin writeln('G');halt;end else
               if i=3 then  begin writeln('R');halt;end;
if pr=2 then
begin
for i:=1 to 3 do
if a[i]<>0 then begin ind1:=i; break;end;
for i:=1 to 3 do
if (a[i]<>0)and(i<>ind1) then begin ind2:=i; break;end;

if (a[ind1]>1)and(a[ind2]>1)then begin writeln('BGR');halt;end else
if (a[ind1]=1)and(a[ind2]=1)then begin
                                 for i:=1 to 3 do
                                 if a[i]=0 then ind3:=i;
                                 if ind3=1 then write('B');
                                 if ind3=2 then write('G');
                                 if ind3=3 then write('R');
                                 halt;end else
                                         begin
                                         for i:=1 to 3 do
                                         if a[i]=0 then ind3:=i;

                                         if a[ind1]=1 then
                                         begin
                                            if ind1>ind3 then begin
                                                              if ind3=1 then write('B');
                                                              if ind3=2 then write('G');
                                                              if ind3=3 then write('R');
                                                              if ind1=1 then write('B');
                                                              if ind1=2 then write('G');
                                                              if ind1=3 then write('R');
                                                              end;
                                            if ind1<ind3 then begin
                                                              if ind1=1 then write('B');
                                                              if ind1=2 then write('G');
                                                              if ind1=3 then write('R');
                                                              if ind3=1 then write('B');
                                                              if ind3=2 then write('G');
                                                              if ind3=3 then write('R');
                                                              end;
                                         end;

                                          if a[ind2]=1 then
                                         begin
                                            if ind2>ind3 then begin
                                                              if ind3=1 then write('B');
                                                              if ind3=2 then write('G');
                                                              if ind3=3 then write('R');
                                                              if ind2=1 then write('B');
                                                              if ind2=2 then write('G');
                                                              if ind2=3 then write('R');
                                                              end;
                                            if ind2<ind3 then begin
                                                              if ind2=1 then write('B');
                                                              if ind2=2 then write('G');
                                                              if ind2=3 then write('R');
                                                              if ind3=1 then write('B');
                                                              if ind3=2 then write('G');
                                                              if ind3=3 then write('R');
                                                              end;
                                         end;

                                         end;

end;

end.

var s:string;
    n,i,kg,kb,kr:longint;
begin
readln(n);
readln(s);
for i:=1 to n do
begin
if s[i]='G' then
inc(kg);
if s[i]='B' then
inc(kb);
if s[i]='R' then
inc(kr);
end;
if (kg<>0) and (kb<>0) and (kr<>0) then
begin
writeln('BGR');
halt;
end;
if ((kg>=2) and (kb>=2)) or ((kr>=2) and (kb>=2)) or ((kg>=2) and (kr>=2)) then
begin
writeln('BGR');
halt;
end;
if (kg>=2) and ((kr=1) or (kb=1)) then
begin
writeln('BR');
halt;
end;
if (kr>=2) and ((kb=1) or (kg=1)) then
begin
writeln('BG');
halt;
end;
if (kb>=2) and ((kr=1) or (kg=1)) then
begin
writeln('GR');
halt;
end;
if (kg=1) and (kr=1) then
begin
writeln('B');
halt;
end;
if (kg=1) and (kb=1) then
begin
writeln('R');
halt;
end;
if (kr=1) and (kb=1) then
begin
writeln('G');
halt;
end;
if (kg>=1) then
begin
writeln('G');
halt;
end;
if (kb>=1) then
begin
writeln('B');
halt;
end;
if (kr>=1) then
begin
writeln('R');
halt;
end;
end.

var
n,r,g,i,b:longint;
st:string;
begin

 readln(n);
 readln(st);
 for i:=1 to n do
  begin
   if st[i]='R' then r:=r+1;
   if st[i]='G' then g:=g+1;
   if st[i]='B' then b:=b+1;
  end;
  if (b=1) and (g=1) and (r=0) then writeln('R')
  else
  if (b=1) and (g=0) and (r=1) then writeln('G')
  else
  if (b=0) and (g=1) and (r=1) then writeln('B')
  else
  if (b>1) and (g=1) and (r=0) then writeln('GR')
  else
  if (b>1) and(g=0) and (r=1) then writeln('GR')
  else
  if (b=1) and (g>1) and (r=0) then writeln('BR')
  else
  if (b=0) and (g>1) and (r=1) then writeln('BR')
  else
  if (b=1) and (g=0) and (r>1) then writeln('BG')
  else
  if (b=0) and (g=1) and (r>1) then writeln('BG')
  else
  if (b>0) and(g=0) and(r=0) then writeln('B')
  else
   if (b=0) and(g>0) and(r=0) then writeln('G')
  else
   if (b=0) and(g=0) and(r>0) then writeln('R')
  else writeln('BGR');

end.

{$mode objfpc}
uses
	math;

var
	fi: text;
	i, j, n, cnt: integer;
	s: ansistring;
	check: array['A'..'Z'] of integer;
	c, last: char;
	res: ansistring;
begin
	assign(fi, ''); reset(fi);
	readln(fi, n); readln(fi, s);
	for i := 1 to n do begin
		if check[s[i]] = 0 then
			inc(cnt);
		inc(check[s[i]]);
		last := s[i];
	end;

	for i := 1 to n do for j := i+1 to n do
		if s[i] > s[j] then begin
			c:= s[i]; s[i] := s[j]; s[j] := c;
		end;
	//

	if cnt = 1 then begin
		writeln(last); exit
	end;

	if cnt = 3 then begin
		writeln('BGR'); exit
	end;

	if (cnt = 2) then begin
		if ((check['R'] > 1) and (check['G'] > 1)) or ((check['R'] > 1) and (check['B'] > 1))
		or ((check['B'] > 1) and (check['G'] >  1)) then begin
			writeln('BGR'); exit end;
	end;
	//

	if (cnt = 2) and (n = 2) then begin
		if (check['B']>0) and (check['R'] > 0) then writeln('G')
		else if (check['B'] =1) and (check['G']=1) then writeln('R')
		else if (check['G'] = 1) and (check['R']=1) then writeln('B');
	end;

	res := '';
	//writeln(cnt);
	if (cnt = 2) and (n > 2) then begin
		for i := 1 to n do
			if check[s[i]] > 1 then begin
				res := res + s[i];
				if length(Res) = 2 then break
			end;
	//	writeln(res);
		if res = 'GG' then writeln('BR');
		if res = 'RR' then writeln('BG');
		if res = 'BB' then writeln('GR');
	end;

end.

uses math;
var b,g,r,bs,gs,rs,i,j,n,k,m,s:longint;
    h:char;
    bb,gb,rb:boolean;

begin
    readln(n);
    for i:=1 to n do
    begin
        read(h);
        if h = 'R' then inc(rs) else
        if h = 'B' then inc(bs) else
                        inc(gs);
    end;

        if gs > 1 then gs:=2;
        if bs > 1 then bs:=2;
        if rs > 1 then rs:=2;

    b:=bs; g:=gs; r:=rs;

    if ((r>0) and (g>0)) or ((r=2) and (b>0)) or ((g=2) and (b>0)) or (r+g=0) then write('B');
    if ((r>0) and (b>0)) or ((r=2) and (g>0)) or ((b=2) and (g>0)) or (r+b=0) then write('G');
    if ((b>0) and (g>0)) or ((b=2) and (r>0)) or ((g=2) and (r>0)) or (b+g=0) then write('R');

end.

var n,m,i,j,k,ans,l,r,ll,rr,p:longint;
    dp:array[0..200,0..200,0..200]of 0..1;
    s:string;
procedure rec(l,r,k:longint);
 begin
   if (dp[l,r,k]=1) then exit;
   dp[l,r,k]:=1;
   if (l>0) and (r>0) then rec(l-1,r-1,k+1);
   if (l>0) and (k>0) then rec(l-1,r+1,k-1);
   if (r>0) and (k>0) then rec(l+1,r-1,k-1);
   if (l>1) then rec(l-1,r,k);
   if (r>1) then rec(l,r-1,k);
   if (k>1) then rec(l,r,k-1);
 end;
  begin
    readln(n);
    readln(s);
    for i:=1 to length(s) do
     if s[i]='R' then l:=l+1 else
     if s[i]='G' then r:=r+1 else k:=k+1;
    rec(l,r,k);
    if dp[0,0,1]=1 then write('B');
    if dp[0,1,0]=1 then write('G');
    if dp[1,0,0]=1 then write('R');
    writeln;
  end.

var
podr,podb,podg,min,n,i,r,g,b:longint;
s:string;
begin
readln(n);
readln(s);
for i:=1 to n do begin
    if s[i]='R' then inc(r);
    if s[i]='B' then inc(b);
    if s[i]='G' then inc(g);
end;
if ((r>0)and(b>0)and(g>0))or((r>=2)and(b>=2))or((r>=2)and(g>=2))or((g>=2)and(b>=2)) then write('BGR')
else
begin
    if (r>=1)and(b=0)and(g=0) then write('R')
    else
    if (r=0)and(b>=1)and(g=0) then write('B')
    else
    if (r=0)and(b=0)and(g>=1) then write('G')
    else
    if (r=1)and(b=1)and(g=0) then write('G')
    else
    if (r=1)and(b=0)and(g=1) then write('B')
    else
    if (r=0)and(b=1)and(g=1) then write('R')
    else
    if (r>=2)and(b=1)and(g=0) then write('BG')
    else
    if (r>=2)and(b=0)and(g=1) then write('BG')
    else
    if (r=1)and(b>=2)and(g=0) then write('GR')
    else
    if (r=1)and(b=0)and(g>=2) then write('BR')
    else
    if (r=0)and(b>=2)and(g=1) then write('GR')
    else
    if (r=0)and(b=1)and(g>=2) then write('BR');

end;
end.

{$mode objfpc}

var
 n,i,r,g,b:longint;
 s:ansistring;
procedure input;
begin
 readln(n);
 read(s);
end;

function tm(x,y,z:longint):boolean;
begin
 if (y>=1) and (z>=1) then exit(true);
 if (y=0) and (z=0) then exit(true);
 if (x>0) and ((y>1) or (z>1)) then exit(true);
 exit(false);
end;

procedure process;
begin
 r:=0;
 g:=0;
 b:=0;
 for i:=1 to length(s) do
  case s[i] of
   'R':inc(r);
   'G':inc(g);
   'B':inc(b);
  end;
 if tm(b,g,r) then write('B');
 if tm(g,r,b) then write('G');
 if tm(r,g,b) then write('R');
end;

begin
 input;
 process;
end.

var i,n,r,g,b:longint;
    S:string;
    begin
    readln(n);
    readln(S); r:=0; g:=0; b:=0;
    for i:=1 to n do
      begin
      if S[i]='G' then g:=g+1;
      if S[i]='R' then r:=r+1;
      if S[i]='B' then b:=b+1;
      end;
    if (r>0) and (g>0) then write('B')
      else if (b>0) and (r=0) and (g=0) then write('B')
        else if (b>0) and ((r>1) or (g>1)) then write('B');

    if (r>0) and (b>0) then write('G')
      else if (g>0) and (r=0) and (b=0) then write('G')
        else if (g>0) and ((r>1) or (b>1)) then write('G');

    if (g>0) and (b>0) then write('R')
      else if (r>0) and (g=0) and (b=0) then write('R')
        else if (r>0) and ((g>1) or (b>1)) then write('R');
    end.

var
   n, i, cr, cg, cb : longint;
   s : ansistring;

begin
    readln(n); readln(s);
    cr := 0; cg := 0; cb := 0;
    for i := 1 to n do
    if (s[i] = 'R') then inc(cr) else if (s[i] = 'G') then inc(cg) else inc(cb);
    if ((cr > 0) and (cg > 0) and (cb > 0))
    or ((cr > 1) and (cb > 1)) or ((cb > 1) and (cg > 1)) or ((cr > 1) and (cg > 1))
    then
    begin
        writeln('BGR');
        halt;
    end;
    if ((cr = 0) and (cg = 0)) or ((cr = 1) and (cg = 1)) then
    begin
        writeln('B');
        halt;
    end;
    if ((cb = 0) and (cg = 0)) or ((cb = 1) and (cg = 1)) then
    begin
        writeln('R');
        halt;
    end;
    if ((cr = 0) and (cb = 0)) or ((cr = 1) and (cb = 1)) then
    begin
        writeln('G');
        halt;
    end;
    if (cr = 1) then
    begin
        if (cg > 1) then writeln('BR') else writeln('GR');
    end
    else if (cg = 1) then
    begin
        if (cb > 1) then writeln('GR') else writeln('BG');
    end
    else
    begin
        if (cr > 1) then writeln('BG') else writeln('BR');
    end;
end.

var r,g,b:longint;
    n,i:integer;
    ch:char;
    r1,b1,g1:boolean;

label outp;

begin
  readln(n);
  for i:=1 to n do
    begin
      read(ch);
      case ch of
        'R': inc(r);
        'B': inc(b);
        'G': inc(g);
      end;
    end;
  if ((r<>0)xor(g<>0)xor(b<>0))and(not((r<>0)and(b<>0)and(g<>0)))
    then
      begin
        if r<>0 then write('R');
        if b<>0 then write('B');
        if g<>0 then write('G');
      end
    else
      begin
        if ((r=1)xor(b=1)xor(g=1))and((r=0)xor(g=0)xor(b=0))
          then
            begin
              if b = 1 then b1:=true;
              if g = 1 then g1:=true;
              if r = 1 then r1:=true;
              if b = 0 then b1:=true;
              if g = 0 then g1:=true;
              if r = 0 then r1:=true;
              goto outp;
            end;

        if r+g+b = 2
          then
            begin
              if r=0 then write('R');
              if b=0 then write('B');
              if g=0 then write('G');
              exit;
            end;
        b1:=true;
        g1:=true;
        r1:=true;
        outp:
        if b1 then write('B');
        if g1 then write('G');
        if r1 then write('R');
      end;

end.

{$MODE OBJFPC}
program dream_hyojoo;
var    n,dem1,dem2,dem3,i:integer;
       s:ansistring;

begin
       //assign(input,'dream_hyojoo.inp');
       //reset(input);
       readln(n);
       readln(s);
       for i:=1 to n do
          begin
              if s[i]='B' then inc(dem1);
              if s[i]='G' then inc(dem2);
              if s[i]='R' then inc(dem3)
          end;
       if ((dem2>0) and (dem3>0)) or ((dem2=0) and (dem3=0))
          or ((dem2>1) and (dem1>0)) or ((dem3>1) and (dem1>0)) then write('B');
       if ((dem1>0) and (dem3>0)) or ((dem1=0) and (dem3=0))
          or ((dem1>1) and (dem2>0)) or ((dem3>1) and (dem2>0)) then write('G');
       if ((dem2>0) and (dem1>0)) or ((dem2=0) and (dem1=0))
          or ((dem2>1) and (dem3>0)) or ((dem1>1) and (dem3>0)) then write('R');
       writeln

end.

var sim:char;
    n,r,b,g,i:longint;
begin
readln(n);
for i:=1 to n do begin
 read(sim);
 if sim='R' then inc(R);
 if sim='B' then inc(B);
 if sim='G' then inc(G);
end;

if (r>0) and (b>0) and (g>0) then begin write('BGR'); halt; end;
if (r>1) and (b>1) and (g=0) then begin write('BGR'); halt; end;
if (r>1) and (b=0) and (g>1) then begin write('BGR'); halt; end;
if (r=0) and (b>1) and (g>1) then begin write('BGR'); halt; end;

if (r=0) and (b=0) and (g>0) then begin write('G'); halt; end;
if (r>0) and (b=0) and (g=0) then begin write('R'); halt; end;
if (r=0) and (b>0) and (g=0) then begin write('B'); halt; end;
if (r=0) and (b=1) and (g=1) then begin write('R'); halt; end;
if (r=1) and (b=1) and (g=0) then begin write('G'); halt; end;
if (r=1) and (b=0) and (g=1) then begin write('B'); halt; end;

if (r>1) and (b=1) and (g=0) then begin write('BG'); halt; end;
if (r>1) and (b=0) and (g=1) then begin write('BG'); halt; end;
if (r=0) and (b=1) and (g>1) then begin write('BR'); halt; end;
if (r=1) and (b=0) and (g>1) then begin write('BR'); halt; end;
if (r=0) and (b>1) and (g=1) then begin write('GR'); halt; end;
if (r=1) and (b>1) and (g=0) then begin write('GR'); halt; end;
end.

var ss:char;
g,b,r,i,n:longint;
begin {
assign(input,'input.txt');
reset(input);
assign(output,'output.txt');
rewrite(output);}
readln(n);  b:=0;g:=0;r:=0;
for i:=1 to n do
 begin
  read(ss);
  if ss='G' then inc(g);
  if ss='B' then inc(b);
  if ss='R' then inc(r);
 end;

if ((b<>0) and (g<>0) and (r<>0)) or ((r>=2) and (g>=2)) or ((b>=2) and (g>=2)) or ((b>=2) and (r>=2))then begin writeln('BGR');halt;end;

if (r>=2) and ((b<>0) or (g<>0)) then begin write('BG');halt;end;

if (g>=2) and ((b<>0) or (r<>0)) then begin write('BR');halt;end;

if (b>=2) and ((r<>0) or (g<>0)) then begin write('GR');halt;end;

if (b<>0) and (g<>0) and (r=0) then begin write ('R');halt;end;

if (b<>0) and (r<>0) and (g=0) then begin write('G');halt;end;

if (g<>0) and (r<>0) and (b=0) then begin write('B');halt;end;

if (b<>0) then begin write('B');halt;end;

if (g<>0) then begin write('G');halt;end;

if (r<>0) then begin write('R');halt;end;

{close(input);
close(output); }
end.

var  i, j, n, m:longint;
a:array[1..3]of longint;
s:string;
begin
readln(n);
read(s);
For i:=1 to n do  case s[i] of
                  'G':inc(a[2]);
                  'R':inc(a[3]);
                  'B':inc(a[1]);
                  end;
if (a[1]>0)and(a[2]>0)and(a[3]>0) then write('BGR')
    else if (a[1]=0)and(a[2]=0)then write('R')
        else if (a[2]=0)and(a[3]=0)then write('B')
            else if (a[1]=0)and(a[3]=0)then write('G')
                else  if a[1]=0 then begin if (a[2]>1)and(a[3]>1) then write('BGR')
                                                                  else
                                                                  if (a[3]=1)and(a[2]=1) then write('B')
                                                           else if a[2]=1 then write('BG')
                                                                          else if a[3]=1 then write('BR');
                                          end
                                     else
                           if a[2]=0 then begin if (a[1]>1)and(a[3]>1) then write('BGR')
                                                           else if (a[1]=1)and(a[3]=1) then write('G')
                                                           else if a[1]=1 then write('BG')
                                                                          else if a[3]=1 then write('GR');
                                          end
                                     else
                           if a[3]=0 then begin if (a[2]>1)and(a[1]>1) then write('BGR')
                                                           else if (a[1]=1)and(a[2]=1) then write('R')
                                                           else if a[2]=1 then write('GR')
                                                                          else if a[1]=1 then write('BR');
                                          end;
End.

var i,j,n,k,B,R,G:longint;q:char;
begin
 readln(n);
 for i:=1 to n do
 begin
  read(q);
  if q='B' then B:=1+b else
  if q='G' then g:=1+g else
  if q='R' then r:=1+r;
  END;
  k:=100*b+10*g+r;
  if k=111 then write('BGR') ELSE
   if k=110 then write('R') ELSE
   if k=101 then write('G') ELSE
   if k=11 then write('B') ELSE
   if k mod 100=0 then write('B') ELSE
   if r+b=0 then write('G') ELSE
   if b+g=0 then write('R') ELSE
   if r+b=1 then write('BR') ELSE
   if b+g=1 then write('BG') ELSE
   if r+G=1 then write('GR') ELSE
    write('BGR') ;
end.

      {$APPTYPE CONSOLE}
const nn=3; besk=2000000000000000000;
   nnn=2000000;  eps=1e-11; modul=1000000007;
 type matr=array[1..3,1..3] of extended;
   mat=^matr;
 label 1,2,3,4;

var i1,j1,k,step,kt,ppp,god,day,mon,mask,i0,j0,i,j,start,finish:longint;
newdl,dloch,kol,shag,m,t,ii,jj,l,r,p,p3,pos,ll,bb,pp,tt,ot1,ot2,s,kold,n:int64;
xx,cc,q,t1,t2,p4,p1,p2,ot,dist1,vt,zap,ba,by,aa,ay,kk,centr,koef:int64;
flag2,flag1,flag:boolean;
ch1,ch2,ch:char;
str:array[-10..12000] of matr;
prob,ccc1,v,rr,h1,h2,h,r1,r2,aaa,bbb,ccc,hh,po,pt,doltek,dolpred:extended;
next,prev,x1,x2,y1,y2,d,och,newoch,f,x,y,fact,c,b,a,prost:array[-100000..1100000] of int64;
oldzan,oldmarked,zan: array[0..330006] of boolean;
gr:array[-1..1001,-1..1001] of boolean;
agor,aver,ssumgor,ssumver,sgor,sver,udd,dostl,dostr: array[-100..600,-100..600] of int64;
det,ott :double;
dd:matr;
d3,d1,d2,dist,edin:matr;
ss,ss1,ss2:string;
za:array[-10..600,-10..600] of boolean;
marked,dost,newdost:array[-10..700000] of boolean;
ssnew:array[-10..1000000] of char;
pole:array[-10..610,-10..600] of char;
name:array[0..2000] of string;
function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

 function nod(x,y:int64):int64; var z:int64;
begin   repeat  z:=x mod y;x:=y;y:=z;   until  z=0 ;  nod:=x;end;

function degg(p,deg:int64):int64; var pp,q:int64;
 begin if deg=0 then degg:=1 else begin   if odd(deg) then degg:=(degg(p,deg-1)*p) mod modul else
 begin q:=(degg(p,deg shr 1)) mod modul; degg:=(q*q) mod modul;   end; end;   end;

begin
 { assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
  }
 readln(n);
  readln(ss);
   for i:=1 to n do
     begin
        if ss[i]='B' then inc(p1);
        if ss[i]='G'  then inc(p2);
        if ss[i]='R'  then inc(p3);

     end;
   if (p1>0)and(p2>0)and(p3>0) then begin  write('BGR'); goto 1; end;
   if p1+p2=0 then begin write('R'); goto 1;  end;
   if p1+p3=0 then begin write('G'); goto 1;  end;
   if p3+p2=0 then begin write('B'); goto 1;  end;

   if (p1=2)and(p2=1) then begin write('GR'); goto 1;  end;
   if (p1=1)and(p2=2) then begin write('BR'); goto 1;  end;

   if (p2=2)and(p3=1) then begin write('BR'); goto 1;  end;
   if (p2=1)and(p3=2) then begin write('BG'); goto 1;  end;

   if (p1=2)and(p3=1) then begin write('GR'); goto 1;  end;
   if (p1=1)and(p3=2) then begin write('BG'); goto 1;  end;

   write('BGR');

   1:          close(output);
end.

program ProjectDCodeforces;

{$APPTYPE CONSOLE}

uses
  SysUtils,Math;

var
  k,i,j,n:integer;
  g,a,b,c,r,d,res:int64;
  s:char;
begin
 // Reset(Input,'input.txt');
 // Rewrite(Output,'output.txt');
  Readln(n);
  r:=0;
  b:=0;
  g:=0;
  for i:=1 to n do
   begin
     read(s);
     case s of
     'R': Inc(r);
     'G': Inc(g);
     'B': Inc(b);
     end;
   end;

  if (r>=1)and(g>=1)and(b>=1)
  then write('BGR')
  else begin
         if (r=0)
         then begin
               if (b>=2)and(g=1)
               then write('GR');
               if (g>=2)and(b=1)
               then write('BR');
               if (b=1)and(g=1)
               then write('R');
              end;

         if (g=0)
         then begin
               if (b>=2)and(r=1)
               then write('GR');
               if (r>=2)and(b=1)
               then write('BG');
               if (b=1)and(r=1)
               then write('G');
              end;
         if (b=0)
         then begin
               if (r>=2)and(g=1)
               then write('BG');
               if (g>=2)and(r=1)
               then write('BR');
               if (g=1)and(r=1)
               then write('B');
              end;
         if (r>0)and(b=0)and(g=0)
         then write('R');
         if (G>0)and(r=0)and(b=0)
         then write('G');
         if (b>0)and(r=0)and(g=0)
         then write('B');
       end;

end.

program ProjectDCodeforces;

{$APPTYPE CONSOLE}

uses
  SysUtils,Math;

var
  k,i,j,n:integer;
  g,a,b,c,r,d,res:int64;
  s:char;
begin
//  Reset(Input,'input.txt');
//  Rewrite(Output,'output.txt');
  Readln(n);
  r:=0;
  b:=0;
  g:=0;
  for i:=1 to n do
   begin
     read(s);
     case s of
     'R': Inc(r);
     'G': Inc(g);
     'B': Inc(b);
     end;
   end;

  if (r>=1)and(g>=1)and(b>=1)
  then write('RGB')
  else begin
         if (r=0)
         then begin
               if (b>=2)and(g=1)
               then write('RG');
               if (g>=2)and(b=1)
               then write('RB');
               if (b=1)and(g=1)
               then write('R');
              end;

         if (g=0)
         then begin
               if (b>=2)and(r=1)
               then write('RG');
               if (r>=2)and(b=1)
               then write('BG');
               if (b=1)and(r=1)
               then write('G');
              end;
         if (b=0)
         then begin
               if (r>=2)and(g=1)
               then write('BG');
               if (g>=2)and(r=1)
               then write('RB');
               if (g=1)and(r=1)
               then write('B');
              end;
         if (r>0)and(b=0)and(g=0)
         then write('R');
         if (G>0)and(r=0)and(b=0)
         then write('G');
         if (b>0)and(r=0)and(g=0)
         then write('B');
       end;

end.

var
  g, r, b:byte;
  c:char;
  i, n:byte;

BEGIN
  g:=0; r:=0; b:=0;
  readln(n);
  for i:=1 to n do begin
    read(c);
    if c='R' then
      inc(r)
    else if c='G' then
      inc(g)
    else
      inc(b);
  end;

 // writeln(r, ' ', g, ' ', b);

  if (r>=1) and (g>=1) and (b>=1) then
    write('BGA')
  else if (r>=2) and (g>=1) and (b=0) then
    write('BGA')
  else if (r>=2) and (g=0) and (b>=1) then
    write('BGA')
  else if (r>=1) and (g>=2) and (b=0) then
    write('BGA')
  else if (r>=1) and (g=0) and (b>=2) then
    write('BGA')
  else if (r=0) and (g>=2) and (b>=1) then
    write('BGA')
  else if (r=0) and (g>=1) and (b>=2) then
    write('BGA')
  else if (r>=2) and (g=1) and (b=0) then
    write('GR')
  else if (r>=2) and (g=0) and (b=1) then
    write('BG')
  else if (r=0) and (g>=2) and (b=1) then
    write('BR')
  else if (r=1) and (g=1) and (b=0) then
    write('B')
  else if (r=1) and (g=0) and (b=1) then
    write('G')
  else if (r=0) and (g=1) and (b=1) then
    write('R')
  else if (r>=2) and (g=0) and (b=0) then
    write('R')
  else if (r=0) and (g>=2) and (b=0) then
    writeln('G')
  else if (r=0) and (g=0) and (b>=2) then
    writeln('B');

END.

var
  g, r, b:byte;
  c:char;
  i, n:byte;

BEGIN
  g:=0; r:=0; b:=0;
  readln(n);
  for i:=1 to n do begin
    read(c);
    if c='R' then
      inc(r)
    else if c='G' then
      inc(g)
    else
      inc(b);
  end;

  if r>=1 then begin
    if r>=2 then begin
      if (b>=2) or (g>=2) then
      write('BGR')
    else if (b>=1) and (g=0) then
      write('BG')
    else if (b=0) and (g=1) then
      write('BG')
    else if (b=0) and (g=0) then
       write('R');
    end
    else begin
      if (b>=1) and (g>=1) then
        write('BGR')
      else if ((b>=2) and (g=0)) then
        write('GR')
      else if ((b=0) and (g>=2))  then
        write('BR')
      else if (r=1) and (b=1) and (g=0) then
        write('G')
      else if (r=1) and (b=0) and (g=1) then
        write('B')
      else if (b=0) and (g=0) then
        write('R');
    end
  end
  else if (b>=1) then  begin
    if (b>=2) and (g>=1) then
      write('GR')
    else if(b=1) and (g>=2) then
      write('BR')
    else if (b=1) and (g=1) then
      write('R')
    else if g=0 then
      write('B');
  end
  else if g>=1 then
    write('G');

END.

const
  SIZE=100000;
type
  TQ = array[1..3] of byte;

var
  q:array[1..SIZE, 1..3] of byte;
  qb, qe:longint;
  res_rd, res_gr, res_bl:boolean;
  i, n, j, k:longint;
  cl:array[1..3] of byte;

Procedure push(r1, g1, b1:byte);
Begin
  q[qe, 1]:=r1;
  q[qe, 2]:=g1;
  q[qe, 3]:=b1;

  if qe=SIZE then
    qe:=1
  else
    inc(qe);
End;

Procedure pop(var r1, g1, b1:byte);
Begin
  r1:=q[qb, 1];
  g1:=q[qb, 2];
  b1:=q[qb, 3];

  if qb=SIZE then
    qb:=1
  else
    inc(qb);
End;

Procedure read_data;
var
  rdc, grc, blc:byte;
  c:char;
Begin
  readln(n);
  rdc:=0;  grc:=0; blc:=0;
  for i:=1 to n do begin
    read(c);
    if c='R' then
      inc(rdc)
    else if c='G' then
      inc(grc)
    else
      inc(blc);
  end;

  res_rd:=false;
  res_gr:=false;
  res_bl:=false;

  qb:=1; qe:=1;
  push(rdc, grc, blc);
End;

Function res_comb(r1, g1, b1:byte):boolean;
Begin
  if r1+g1+b1=1 then begin
    if r1=1 then
      res_rd:=true
    else if g1=1 then
      res_gr:=true
    else
      res_bl:=true;

    res_comb:=true;
  end
  else
    res_comb:=false;
End;

BEGIN
  read_data;

  while qb<>qe do begin
    pop(cl[1], cl[2], cl[3]);

    if res_comb(cl[1], cl[2], cl[3])=false then begin
      for i:=1 to 3 do begin
        if cl[i]>=2 then begin
          j:=qe;
          push(cl[1], cl[2], cl[3]);
          dec(q[j, i]);
        end;
        if cl[i]>=1 then
          for k:=i+1 to 3 do
            if (cl[k]>=1) then begin
              j:=qe;
              push(cl[1], cl[2], cl[3]);
              inc(q[j, 6-i-k]);
              dec(q[j, k]);
              dec(q[j, i]);
            end;
      end;
    end;

  end;

  if res_bl then
    write('B');
  if res_gr then
    write('G');
  if res_rd then
    write('R');

END.

var
  g, r, b:byte;
  c:char;
  i, n:byte;

BEGIN
  g:=0; r:=0; b:=0;
  readln(n);
  for i:=1 to n do begin
    read(c);
    if c='R' then
      inc(r)
    else if c='G' then
      inc(g)
    else
      inc(b);
  end;

  if r>=1 then begin
    if r>=2 then begin
      if (b>=2) or (g>=2) then
      write('BGR')
    else if (b>=1) and (g=0) then
      write('BG')
    else if (b=0) and (g=1) then
      write('BG')
    else if (b=0) and (g=0) then
       write('R');
    end
    else begin
      if (b>=1) and (g>=1) then
        write('BGR')
      else if ((b>=2) and (g=0)) then
        write('GR')
      else if ((b=0) and (g>=2))  then
        write('BR')
      else if (r=1) and (b=1) and (g=0) then
        write('G')
      else if (r=1) and (b=0) and (g=1) then
        write('B')
      else if (b=0) and (g=0) then
        write('R');
    end
  end
  else if (b>=1) then  begin
    if (b>=2) and (g>=2) then
      write('BGR')
    else if (b>=2) and (g>=1) then
      write('GR')
    else if(b=1) and (g>=2) then
      write('BR')
    else if (b=1) and (g=1) then
      write('R')
    else if g=0 then
      write('B');
  end
  else if g>=1 then
    write('G');

END.

var
  g, r, b:byte;
  c:char;
  i, n:byte;

BEGIN
  g:=0; r:=0; b:=0;
  readln(n);
  for i:=1 to n do begin
    read(c);
    if c='R' then
      inc(r)
    else if c='G' then
      inc(g)
    else
      inc(b);
  end;

  if r>=2 then begin
    if (b>=2) or (g>=2) then
      write('BGR')
    else if ((b>=1) and (g=0)) or ((b=0) and (g>=1)) then
      write('BG')
    else if (b=0) and (g=0) then
       write('R');
  end
  else if r>=1 then begin
    if (b>=1) and (g>=1) then
      write('BGR')
    else if ((b>=2) and (g=0)) then
      write('GR')
    else if ((b=0) and (g>=2))  then
      write('BR')
    else if (r=1) and (b=1) and (g=0) then
      write('G')
    else if (r=1) and (b=0) and (g=1) then
      write('B');
  end
  else if (r=1) and (b=0) and (g=0) then
    write('R')
  else if (b=1) and (r=0) and (g=0) then
    write('B')
  else if (r=0) and (b=0) and (g=1) then
    write('G')
  else if (b>=2) then  begin
    if g>=1 then
      write('GR')
    else if g=0 then
      write('B');
  end
  else if (b>=1) and (g>=2) then
    write('BR')
  else if (b=1) and (g=1) then
    write('R')
  else if g>=2 then
    write('G');

END.

var
  g, r, b:byte;
  c:char;
  i, n:byte;

BEGIN
  g:=0; r:=0; b:=0;
  readln(n);
  for i:=1 to n do begin
    read(c);
    if c='R' then
      inc(r)
    else if c='G' then
      inc(g)
    else
      inc(b);
  end;

  if r>=2 then begin
    if (b>=2) or (g>=2) then
      write('BGR')
    else if ((b>=1) and (g=0)) or ((b=0) and (g>=1)) then
      write('BG')
    else if (b=0) and (g=0) then
       write('R');
  end
  else if r>=1 then begin
    if (b>=1) and (g>=1) then
      write('BGR')
    else if ((b>=2) and (g=0)) then
      write('GR')
    else if ((b=0) and (g>=2))  then
      write('BR')
    else if (r=1) and (b=1) and (g=0) then
      write('G')
    else if (r=1) and (b=0) and (g=1) then
      write('B')
    else if (b=0) and (g=0) then
      write('R');
  end
  else if (b>=1) then  begin
    if (b>=2) and (g>=1) then
      write('GR')
    else if (b=1) and (g=1) then
      write('R')
    else if g=0 then
      write('B');
  end
  else if g>=1 then
    write('G');

END.

var
n,i,k,j:longint;
a,b:array[1..100] of longint;
s:string;
begin
readln(n);
readln(s);
for i:=1 to n do begin
                 if s[i]='B' then inc(a[1]);
                 if s[i]='G' then inc(a[2]);
                 if s[i]='R' then inc(a[3]);
                 end;
  if a[1]*a[2]*a[3]>0 then begin write('BGR'); halt; end;
  for i:=1 to 3 do if a[i]=0 then begin inc(k); b[i]:=1; end;
  if k=1 then begin
    if b[1]=1 then begin
    if (a[2]>1) and (a[3]>1) then begin write('BGR'); halt; end;
    if (a[2]>1) and (a[3]=1) then begin write('BR'); halt; end;
    if (a[2]=1) and (a[3]>1) then begin write('BG'); halt; end;
    if (a[2]=1) and (a[3]=1) then begin write('B'); halt; end;
    end;
    if b[2]=1 then begin
    if (a[3]>1) and (a[1]>1) then begin write('BGR'); halt; end;
    if (a[3]>1) and (a[1]=1) then begin write('BG'); halt; end;
    if (a[3]=1) and (a[1]>1) then begin write('GR'); halt; end;
    if (a[3]=1) and (a[1]=1) then begin write('G'); halt; end;
    end;
    if b[3]=1 then begin
    if (a[2]>1) and (a[1]>1) then begin write('BGR'); halt; end;
    if (a[2]>1) and (a[1]=1) then begin write('GR'); halt; end;
    if (a[2]=1) and (a[1]>1) then begin write('RB'); halt; end;
    if (a[2]=1) and (a[1]=1) then begin write('R'); halt; end;
    end;
    end;
    if k=2 then begin
    for i:=1 to 3 do if b[i]=0 then begin
    if i=1 then begin write('B'); halt; end;
    if k=1 then begin write('G'); halt; end;
    if k=1 then begin write('R'); halt; end;
    end;
    end;
    end.

var
n,i,k,j:longint;
a,b:array[1..100] of longint;
s:string;
begin
readln(n);
readln(s);
//s:='RRRRR';
for i:=1 to n do begin
                 if s[i]='B' then inc(a[1]);
                 if s[i]='G' then inc(a[2]);
                 if s[i]='R' then inc(a[3]);
                 end;
  if a[1]*a[2]*a[3]>0 then begin write('BGR'); halt; end;
  for i:=1 to 3 do if a[i]=0 then begin inc(k); b[i]:=1; end;
  if k=1 then begin
    if b[1]=1 then begin
    if (a[2]>1) and (a[3]>1) then begin write('BGR'); halt; end;
    if (a[2]>1) and (a[3]=1) then begin write('BR'); halt; end;
    if (a[2]=1) and (a[3]>1) then begin write('BG'); halt; end;
    if (a[2]=1) and (a[3]=1) then begin write('B'); halt; end;
    end;
    if b[2]=1 then begin
    if (a[3]>1) and (a[1]>1) then begin write('BGR'); halt; end;
    if (a[3]>1) and (a[1]=1) then begin write('BG'); halt; end;
    if (a[3]=1) and (a[1]>1) then begin write('GR'); halt; end;
    if (a[3]=1) and (a[1]=1) then begin write('G'); halt; end;
    end;
    if b[3]=1 then begin
    if (a[2]>1) and (a[1]>1) then begin write('BGR'); halt; end;
    if (a[2]>1) and (a[1]=1) then begin write('GR'); halt; end;
    if (a[2]=1) and (a[1]>1) then begin write('BR'); halt; end;
    if (a[2]=1) and (a[1]=1) then begin write('R'); halt; end;
    end;
    end;
    if k=2 then begin
    for i:=1 to 3 do if b[i]=0 then begin
    if i=1 then begin write('B'); halt; end;
    if i=2 then begin write('G'); halt; end;
    if i=3 then begin write('R'); halt; end;
    end;
    end;
    end.

var
i,j,k,n,m,q,w,x,y:longint;
a:array[1..100] of longint;
s:string;
begin
    readln(n);
    read(s);
    for i:=1 to n do
    begin
        if s[i]='R' then inc(a[1]);
        if s[i]='B' then inc(a[2]);
        if s[i]='G' then inc(a[3]);
    end;
    if (a[1]>=1) and (a[2]>=1) and (a[3]>=1) and (n>3) then write('BGR')
    else
    if a[1]=n then write('R')
    else
    if a[2]=n then write('B')
    else
    if a[3]=n then write('G')
    else
    if (a[1]=1) and (a[2]=1) then write('G')
    else
    if (a[1]=1) and (a[3]=1) then write('B')
    else
    if (a[2]=1) and (a[3]=1) then write('R')
    else
    if (a[1]=1) and (a[2]=1) and (a[3]=1) then write('BGR')
    else
    if (a[1]=1) and (a[2]=2) then write('GR')
    else
    if (a[1]=1) and (a[3]=2) then write('BR')
    else
    if (a[2]=1) and (a[1]=2) then write('BG')
    else
    if (a[2]=1) and (a[3]=2) then write('BR')
    else
    if (a[3]=1) and (a[1]=2) then write('BG')
    else
    if (a[3]=1) and (a[2]=2) then write('GR')
    else
    if (a[1]=3) and (a[2]=1) then write('BG')
    else
    if (a[1]=3) and (a[3]=1) then write('BG')
    else
    if (a[2]=3) and (a[1]=1) then write('GR')
    else
    if (a[2]=3) and (a[3]=1) then write('GR')
    else
    if (a[3]=3) and (a[1]=1) then write('BR')
    else
    if (a[3]=3) and (a[2]=1) then write('BR')
    else
    if (a[1]=0) and (a[2]>1) and (a[3]>1) then write('BGR')
    else
    if (a[2]=0) and (a[1]>1) and (a[3]>1) then write('BGR')
    else
    if (a[3]=0) and (a[1]>1) and (a[2]>1) then write('BGR');

end.

var
s:string;
n,b,r,g:longint;
bb,rr,gg:boolean;
procedure find( b,g,r:longint);
var
s:longint;
begin
s:=b+r+g;
if s=2 then
        begin
        if b=2 then bb:=true else
        if r=2 then rr:=true else
        if g=2 then gg:=true else
        if b=0 then bb:=true else
        if g=0 then gg:=true else
        rr:=true;
        end
else
        begin
        if b>1 then find(b-1,g,r);
        if g>1 then find(b,g-1,r);
        if r>1 then find(b,g,r-1);
        if (b>0) and (g>0) then find(b-1,g-1,r+1);
        if (b>0) and (r>0) then find(b-1,g+1,r-1);
        if (r>0) and (g>0) then find(b+1,g-1,r-1);
        end;
end;

var
i:longint;
begin
bb:=false;
gg:=false;
rr:=false;
readln(n);
readln(s);
b:=0;
r:=0;
g:=0;
for i:=1 to n do
begin
if s[i]='B' then inc(b) else
if s[i]='G' then inc(g) else
inc(r);
end;
find(b,g,r);
if bb then write('B');
if gg then write('G');
if rr then write('R');
end.

var
s:string;
n,b,r,g:longint;
bb,rr,gg:boolean;
procedure find( b,g,r:longint);
var
s:longint;
begin
s:=b+r+g;
if s=1 then
        begin
        if b=1 then bb:=true else
        if g=1 then gg:=true else
        rr:=true;
        end;
if s=2 then
        begin
        if b=2 then bb:=true else
        if r=2 then rr:=true else
        if g=2 then gg:=true else
        if b=0 then bb:=true else
        if g=0 then gg:=true else
        rr:=true;
        end
else
        begin
        if b>1 then find(b-1,g,r);
        if g>1 then find(b,g-1,r);
        if r>1 then find(b,g,r-1);
        if (b>0) and (g>0) then find(b-1,g-1,r+1);
        if (b>0) and (r>0) then find(b-1,g+1,r-1);
        if (r>0) and (g>0) then find(b+1,g-1,r-1);
        end;
end;

var
i:longint;
begin
bb:=false;
gg:=false;
rr:=false;
readln(n);
readln(s);
b:=0;
r:=0;
g:=0;
for i:=1 to n do
begin
if s[i]='B' then inc(b) else
if s[i]='G' then inc(g) else
inc(r);
end;
        if (b=0) and (g=0) then  begin writeln('R'); halt(0);  end;
        if (r=0) and (g=0) then  begin writeln('B'); halt(0);  end;
        if (b=0) and (r=0) then  begin writeln('G'); halt(0);  end;
        if n>20 then
                begin
                writeln('BGR');
                halt(0);
                end;
find(b,g,r);
if bb then write('B');
if gg then write('G');
if rr then write('R');
end.

var
a,b,c,n,i,q:longint;
s:string;
begin
readln(N);
readln(s);
for i:=1 to n do begin
if s[i]='B'
then inc(A);
if s[i]='G'
then inc(b);
if s[i]='R'
then inc(c);
end;
if a>1
then inc(Q);
if b>1
then inc(Q);
if c>1
then inc(Q);
if (Q>1) or ((a>0) and (b>0) and (c>0))
then begin writeln('BGR'); halt; end;
if q=0
then begin
if a+b+c=2
then begin
if a=0
then writeln('B');
if b=0
then writeln('G');
if c=0
then writeln('R');
end;
if a+b+c=1
then begin
if a=1
then writeln('B');
if b=1
then writeln('G');
if c=1
then writeln('R');
end;
end;
if (a+b+c=a) or (a+b+c=b) or (a+b+c=c)
then begin
if a+b+c=a
then writeln('B');
if a+b+c=b
then writeln('G');
if a+b+c=c
then writeln('R');
halt;
end;
if q=1
then begin
if a>1
then writeln('GR');
if b>1
then writeln('BR');
if c>1
then writeln('BG');
end;
end.

var
  so: string;

function men1(st: string; a, b: integer): string;
var
  s1, s2: string[1];
  s: string[3];
  st1: string[200];
begin
  st1 := st;
  s := 'BGR';
  s1 := copy(st1, a, 1);
  s2 := copy(st1, b, 1);
  delete(st1, a, 1);
  delete(st1, b-1, 1);
  delete(s, pos(s1, s), 1);
  delete(s, pos(s2, s), 1);
  st1 := s + st1;
  men1 := st1
end;

function men2(st: string; a, b: integer): string;
var
  s: string[1];
  st1: string[200];
begin
  st1 := st;
  s := copy(st1, a, 1);
  delete(st1, a, 1);
  delete(st1, b-1, 1);
  st1 := s + st1;
  men2 := st1
end;

function meno(var st: string; a, b: integer): string;
var
  s1, s2: string[1];
begin
  s1 := copy(st, a, 1);
  s2 := copy(st, b, 1);
  if s1 = s2 then
    meno := men2(st, a, b)
  else
    meno := men1(st, a, b)
end;

procedure men(st: string);
var
  i, j: integer;
begin
  if length(st) >= 2 then
  begin
    for i := 1 to length(st)-1 do
      for j := i to length(st) do
        if i <> j then
          men(meno(st, i, j))
  end
  else
    if pos(st, so)=0 then
    so := so + st
end;

var
  n: integer;
  st: string[200];

begin
  Readln(n);
  Readln(st);

  men(st);

  Writeln(so)
end.

var
  so: string;
  pr: boolean;

function prov(st: string): boolean;
var
  i, k: integer;
  s1: string[1];
begin
  k := 1;
  prov := true;
  s1 := copy(st, 1, 1);
  for i := 2 to length(st) do
    if s1 = copy(st, i, 1) then
      k := k + 1;
  if k = length(st) then
    prov := false
end;

function men1(st: string; a, b: integer): string;
var
  s1, s2: string[1];
  s: string[3];
  st1: string[205];
begin
  st1 := st;
  s := 'BGR';
  s1 := copy(st1, a, 1);
  s2 := copy(st1, b, 1);
  delete(st1, a, 1);
  delete(st1, b - 1, 1);
  delete(s, pos(s1, s), 1);
  delete(s, pos(s2, s), 1);
  st1 := s + st1;
  men1 := st1
end;

function men2(st: string; a, b: integer): string;
var
  s: string[1];
  st1: string[205];
begin
  st1 := st;
  s := copy(st1, a, 1);
  delete(st1, a, 1);
  delete(st1, b - 1, 1);
  st1 := s + st1;
  men2 := st1
end;

function meno(var st: string; a, b: integer): string;
var
  s1, s2: string[1];
  t: integer;
begin
  s1 := copy(st, a, 1);
  s2 := copy(st, b, 1);
  if a > b then
  begin
    t := a;
    a := b;
    b := t
  end;
  if s1 = s2 then
    meno := men2(st, a, b)
  else
    meno := men1(st, a, b)
end;

procedure men(st: string);
var
  i, j, a1, b1, c1, a2, b2, c2: integer;
  si, sa, sb, sc: string[205];
  pr1: boolean;
begin
  pr1 := prov(st);
  if (length(st) >= 2) and pr and pr1 then
  begin
    a1 := pos('B', st);
    sa := copy(st, a1 + 1, length(st));
    a2 := pos('B', sa) + a1;
    b1 := pos('G', st);
    sb := copy(st, b1 + 1, length(st));
    b2 := pos('G', sb) + b1;
    c1 := pos('R', st);
    sc := copy(st, c1 + 1, length(st));
    c2 := pos('R', sc) + c1;

    if ((a1 = 0) and (b1 <> 0) and (c1 <> 0)) then
      men(meno(st, b1, c1))
      else
    if ((b1 = 0)  and (a1 <> 0) and (c1 <> 0)) then
      men(meno(st, a1, c1))
        else
    if ((c1 = 0) and (b1 <> 0) and (a1 <> 0)) then
      men(meno(st, a1, b1))
          else
    if ((a1 <> 0) and (b1 <> 0) and (c1 <> 0)) then
    begin
      men(meno(st, a1, b1));
      men(meno(st, c1, b1));
      men(meno(st, a1, c1))
    end;

    if (a1 <> 0) and (a2 <> a1) then
      men(meno(st, a1, a2));
    if (b1 > 0) and (b2 > b1) then
      men(meno(st, b1, b2));
    if (c1 <> 0) and (c2 <> c1) then
      men(meno(st, c1, c2));
  end
  else
  if pos(st, so) = 0 then
    so := so + st
    else
  if (not pr1) then
    men(copy(st, 1, 1));
  if length(so) = 3 then
    pr := false;

end;

var
  n: integer;
  st: string[205];
  so1: string[3];
  a, b, c, i: integer;

begin
  Readln(n);
  Readln(st);

  a := 0;
  b := 0;
  c := 0;
  pr := true;
  for i := 1 to length(st) do
  begin
    if copy(st, i, 1) = 'B' then
      a := a + 1;
    if copy(st, i, 1) = 'G' then
      b := b + 1;
    if copy(st, i, 1) = 'R' then
      c := c + 1;
  end;
  st := '';
  if a <> 0 then
    if a mod 2 = 1 then
      st := st + 'B'
    else
      st := st + 'BB';
  if b <> 0 then
    if b mod 2 = 1 then
      st := st + 'G'
    else
      st := st + 'GG';
  if c <> 0 then
    if c mod 2 = 1 then
      st := st + 'R'
    else
      st := st + 'RR';
  men(st);
  so1 := '';

  if pos('B', so) <> 0 then
    so1 := 'B';
  if pos('G', so) <> 0 then
    so1 := so1 + 'G';
  if pos('R', so) <> 0 then
    so1 := so1 + 'R';

  Writeln(so1)
end.

var
  so: string;
  pr: boolean;

function prov(st: string): boolean;
var
  i, k: integer;
  s1: string[1];
begin
  k := 1;
  prov := true;
  s1 := copy(st, 1, 1);
  for i := 2 to length(st) do
    if s1 = copy(st, i, 1) then
      k := k + 1;
  if k = length(st) then
    prov := false
end;

function men1(st: string; a, b: integer): string;
var
  s1, s2: string[1];
  s: string[3];
  st1: string[205];
begin
  st1 := st;
  s := 'BGR';
  s1 := copy(st1, a, 1);
  s2 := copy(st1, b, 1);
  delete(st1, a, 1);
  delete(st1, b - 1, 1);
  delete(s, pos(s1, s), 1);
  delete(s, pos(s2, s), 1);
  st1 := s + st1;
  men1 := st1
end;

function men2(st: string; a, b: integer): string;
var
  s: string[1];
  st1: string[205];
begin
  st1 := st;
  s := copy(st1, a, 1);
  delete(st1, a, 1);
  delete(st1, b - 1, 1);
  st1 := s + st1;
  men2 := st1
end;

function meno(var st: string; a, b: integer): string;
var
  s1, s2: string[1];
  t: integer;
begin
  s1 := copy(st, a, 1);
  s2 := copy(st, b, 1);
  if a > b then
  begin
    t := a;
    a := b;
    b := t
  end;
  if s1 = s2 then
    meno := men2(st, a, b)
  else
    meno := men1(st, a, b)
end;

procedure men(st: string);
var
  i, j, a1, b1, c1, a2, b2, c2: integer;
  si, sa, sb, sc: string[205];
  pr1: boolean;
begin
pr1:=true;
if length(st)>50 then
  pr1 := prov(st);
  if (length(st) >= 2) and pr and pr1 then
  begin
    a1 := pos('B', st);
    sa := copy(st, a1 + 1, length(st));
    a2 := pos('B', sa) + a1;
    b1 := pos('G', st);
    sb := copy(st, b1 + 1, length(st));
    b2 := pos('G', sb) + b1;
    c1 := pos('R', st);
    sc := copy(st, c1 + 1, length(st));
    c2 := pos('R', sc) + c1;

    if ((a1 = 0) and (b1 <> 0) and (c1 <> 0)) then
      men(meno(st, b1, c1))
      else
    if ((b1 = 0)  and (a1 <> 0) and (c1 <> 0)) then
      men(meno(st, a1, c1))
        else
    if ((c1 = 0) and (b1 <> 0) and (a1 <> 0)) then
      men(meno(st, a1, b1))
          else
    if ((a1 <> 0) and (b1 <> 0) and (c1 <> 0)) then
    begin
      men(meno(st, a1, b1));
      men(meno(st, c1, b1));
      men(meno(st, a1, c1))
    end;

    if (a1 <> 0) and (a2 <> a1) then
      men(meno(st, a1, a2));
    if (b1 > 0) and (b2 > b1) then
      men(meno(st, b1, b2));
    if (c1 <> 0) and (c2 <> c1) then
      men(meno(st, c1, c2));
  end
  else
  if pos(st, so) = 0 then
    so := so + st
    else
  if (not pr1) then
    men(copy(st, 1, 1));
  if length(so) = 3 then
    pr := false;

end;

var
  n: integer;
  st: string[205];
  so1: string[3];
  a, b, c, i: integer;

begin
  Readln(n);
  Readln(st);

  a := 0;
  b := 0;
  c := 0;
  pr := true;
  if n>40 then
  begin
  for i := 1 to length(st) do
  begin
    if copy(st, i, 1) = 'B' then
      a := a + 1;
    if copy(st, i, 1) = 'G' then
      b := b + 1;
    if copy(st, i, 1) = 'R' then
      c := c + 1;
  end;
  st := '';
    if a <> 0 then
      if a mod 2 = 1 then
        st := st + 'B'
      else
        st := st + 'BB';
  if b <> 0 then
    if b mod 2 = 1 then
      st := st + 'G'
    else
      st := st + 'GG';
  if c <> 0 then
    if c mod 2 = 1 then
      st := st + 'R'
    else
      st := st + 'RR'
      end;
  men(st);
  so1 := '';

  if pos('B', so) <> 0 then
    so1 := 'B';
  if pos('G', so) <> 0 then
    so1 := so1 + 'G';
  if pos('R', so) <> 0 then
    so1 := so1 + 'R';

  Writeln(so1)
end.

var s,st,dop,dkl:string;
och:array[1..50000]of string;
p1,p2,i,j,kl,kol,n,n2:longint;

procedure put(x:string);
begin
  p2:=p2+1;
  och[p2]:=x;
end;

procedure get(var x:string);
begin
  x:=och[p1];
  p1:=p1+1;
end;

begin
  readln(n);
  readln(st);
  p1:=1;
  put(st);
  while p1<=p2 do
  begin
    get(s);
    n:=length(s);
    for i:=1 to n-1 do
    begin
      kl:=0;
      for j:=i+1 to n do
        if (s[i]=s[j]) and (kl=0) then
                                      begin
                                        dop:=s;
                                        delete(dop,i,1);
                                        delete(dop,j-1,1);
                                        dop:=dop+s[i];
                                        n2:=length(dop);
                                        if (n2=1)
                                        and (pos(dop,dkl)=0) then begin
                                                                    kol:=kol+1;
                                                                    dkl:=dkl+dop;
                                                                  end
                                        else if n2<>1 then put(dop);
                                        kl:=1;
                                       end
        else if s[i]<>s[j]
        then
        begin
          dop:=s;
          delete(dop,i,1);
           delete(dop,j-1,1);
         if ((s[i]='B') and (s[j]='G')) or ((s[i]='G') and (s[j]='B')) then dop:=dop+'R'
         else if ((s[i]='B') and (s[j]='R')) or ((s[i]='R') and (s[j]='B')) then dop:=dop+'G'
         else if ((s[i]='G') and (s[j]='R')) or ((s[i]='R') and (s[j]='G')) then dop:=dop+'B';
         n2:=length(dop);
         if (n2=1) and (pos(dop,dkl)=0) then begin
                                               kol:=kol+1;
                                               dkl:=dkl+dop;
                                             end
         else if n2<>1 then put(dop);
         end;
    end;
  end;
  writeln(dkl);
end.

var s,st,dop,dkl:string;
max:char;
och:array[1..50000]of string;
p1,p2,i,nmax,j,kl,kol,n,n2:longint;

procedure put(x:string);
begin
  p2:=p2+1;
  och[p2]:=x;
end;

procedure get(var x:string);
begin
  x:=och[p1];
  p1:=p1+1;
end;

begin
  readln(n);
  readln(st);
  p1:=1;
  put(st);
  while p1<=p2 do
  begin
    get(s);
    n:=length(s);
    for i:=1 to n-1 do
    begin
      kl:=0;
      for j:=i+1 to n do
        if (s[i]=s[j]) and (kl=0) then
                                      begin
                                        dop:=s;
                                        delete(dop,i,1);
                                        delete(dop,j-1,1);
                                        dop:=dop+s[i];
                                        n2:=length(dop);
                                        if (n2=1)
                                        and (pos(dop,dkl)=0) then begin
                                                                    kol:=kol+1;
                                                                    dkl:=dkl+dop;
                                                                  end
                                        else if n2<>1 then put(dop);
                                        kl:=1;
                                       end
        else if s[i]<>s[j]
        then
        begin
          dop:=s;
          delete(dop,i,1);
           delete(dop,j-1,1);
         if ((s[i]='B') and (s[j]='G')) or ((s[i]='G') and (s[j]='B')) then dop:=dop+'R'
         else if ((s[i]='B') and (s[j]='R')) or ((s[i]='R') and (s[j]='B')) then dop:=dop+'G'
         else if ((s[i]='G') and (s[j]='R')) or ((s[i]='R') and (s[j]='G')) then dop:=dop+'B';
         n2:=length(dop);
         if (n2=1) and (pos(dop,dkl)=0) then begin
                                               kol:=kol+1;
                                               dkl:=dkl+dop;
                                             end
         else if n2<>1 then put(dop);
         end;
    end;
  end;
  n:=length(dkl);
  for i:=1 to n-1 do
  begin
    max:=dkl[i];
    nmax:=i;
    for j:=1 to n do
      if dkl[j]<max then begin
                           max:=dkl[j];
                           nmax:=j;
                         end;
    dkl[nmax]:=dkl[i];
    dkl[i]:=max;
  end;
  writeln(dkl);
end.

var
n,i,r,g,b,p:longint;
st,st2:string;
 procedure rek(r,g,b,n:longint);
  begin
   if (r>=1) and (g>=1) then rek(r-1,g-1,b+1,n-1);
   if (r>=1) and (b>=1) then rek(r-1,g+1,b-1,n-1);
   if r>=2 then rek(r-1,g,b,n-1);
   if (g>=1) and (b>=1) then rek(r+1,g-1,b-1,n-1);
   if g>=2 then rek(r,g-1,b,n-1);
   if b>=2 then rek(r,g,b-1,n-1);
   if n=1 then begin
               if r=1 then begin
                           p:=pos('R',st2);
                           if p=0 then st2:=st2+'R';
                           end;
               if g=1 then begin
                           p:=pos('G',st2);
                           if p=0 then st2:=st2+'G';
                           end;
               if b=1 then begin
                           p:=pos('B',st2);
                           if p=0 then st2:=st2+'B';
                           end;
               end;
  end;
begin

 readln(n);
 readln(st);
 for i:=1 to n do
  begin
   if st[i]='R' then r:=r+1;
   if st[i]='G' then g:=g+1;
   if st[i]='B' then b:=b+1;
  end;
  rek(r,g,b,n);
  writeln(st2);
end.

var st,c,st1,s:string;
p1,p2,i,n,k,p,k1:longint;
begin
  readln(n);
  readln(st);
  n:=length(st);
  c:='RGB';
  while true do
   begin

    if st[1]=st[2] then begin
                         delete(st,1,1);
                         st1:=st1+st[1];
                         k:=k+1;
                        end
    else if st[1]<>st[2] then begin
                               p1:=pos(st[1],c);
                               p2:=pos(st[2],c);
                               for i:=1 to 3 do
                                if (i<>p1) and (i<>p2) then begin
                                                             delete(st,1,2);
                                                             st:=st+c[i];
                                                             st1:=st1+c[i];
                                                             k:=k+1;
                                                             break;
                                                            end;
                              end;
     n:=length(st);
     if n<=1 then break;
   end;
  for i:=1 to k do
   begin
    p:=pos(st1[i],s);
    if p=0 then begin
                 s:=s+st1[i];
                 k1:=k1+1;
                end;
    if k1=3 then break;
   end;
  writeln(s);
end.

var st,c,st1,s:string;
p1,p2,i,n,k,p,k1,nmax,j:longint;
max,dop:char;
begin
  readln(n);
  readln(st);
  n:=length(st);
  c:='RGB';
  while true do
   begin

    if st[1]=st[2] then begin
                         delete(st,1,1);
                         st1:=st1+st[1];
                         k:=k+1;
                        end
    else if st[1]<>st[2] then begin
                               p1:=pos(st[1],c);
                               p2:=pos(st[2],c);
                               for i:=1 to 3 do
                                if (i<>p1) and (i<>p2) then begin
                                                             delete(st,1,2);
                                                             st:=st+c[i];
                                                             st1:=st1+c[i];
                                                             k:=k+1;
                                                             break;
                                                            end;
                              end;
     n:=length(st);
     if n<=1 then break;
   end;

  for i:=1 to k  do
   begin
    p:=pos(st1[i],s);
    if p=0 then begin
                 s:=s+st1[i];
                 k1:=k1+1;
                end;
    if k1=3 then break;
   end;
   if k1>1 then begin
                 for i:=1 to k1-1 do
                  begin
                   max:=s[i];
                   nmax:=i;
                   for j:=i+1 to n do
                    if max>s[j] then begin
                                      max:=s[j];
                                      nmax:=j;
                                     end;
                   dop:=s[i];
                   s[i]:=max;
                   s[nmax]:=dop;
                  end;
                end;
  writeln(s);
end.

var st,c,st1,s:string;
p1,p2,i,n,k,p,k1,nmax,j:longint;
max,dop:char;
begin
  readln(n);
  readln(st);
  n:=length(st);
  c:='RGB';
  while true do
   begin

    if st[1]=st[2] then begin
                         delete(st,1,1);
                         st1:=st1+st[1];
                         k:=k+1;
                        end
    else if st[1]<>st[2] then begin
                               p1:=pos(st[1],c);
                               p2:=pos(st[2],c);
                               for i:=1 to 3 do
                                if (i<>p1) and (i<>p2) then begin
                                                             delete(st,1,2);
                                                             st:=st+c[i];
                                                             st1:=st1+c[i];
                                                             k:=k+1;
                                                             break;
                                                            end;
                              end;
     n:=length(st);
     if n<=1 then break;
   end;
  for i:=1 to k do
   begin
    p:=pos(st1[i],s);
    if p=0 then begin
                 s:=s+st1[i];
                 k1:=k1+1;
                end;
    if k1=3 then break;
   end;
   if k1>1 then begin
                 for i:=1 to k1-1 do
                  begin
                   max:=s[i];
                   nmax:=i;
                   for j:=i+1 to n do
                    if max>s[j] then begin
                                      max:=s[j];
                                      nmax:=j;
                                     end;
                   dop:=s[i];
                   s[i]:=max;
                   s[nmax]:=dop;
                  end;
                end;
  writeln(s);
end.

var st:string;
n,i,r,g,b:longint;
begin
  readln(n);
  readln(st);
  for i:=1 to n do
    if st[i]='R' then r:=r+1
                 else if st[i]='G' then g:=g+1
                 else b:=b+1;

  if ((r=1) and (g=1) and (b=0)) or
     ((r=0) and (g=0)) then begin
                             writeln('B');
                             halt;
                            end
                     else if ((b=1) and (g=1) and (r=0)) or
                             ((b=0) and (g=0)) then begin
                                                     writeln('R');
                                                     halt;
                                                    end
                     else if ((b=1) and (r=1) and (g=0)) or
                             ((b=0) and (r=0)) then begin
                                                     writeln('G');
                                                     halt;
                                                    end;

  if ((g=0) and (r>=2) and (b>=2)) or
     ((b=0) and (r>=2) and (g>=2)) or
     ((r=0) and (b>=2) and (g>=2)) or
     ((r>0) and (b>0) and (r>0)) then begin
                                       writeln('BGR');
                                       halt;
                                      end;
  if (g=1) and (r=0) and (b>1) then begin
                                     writeln('GR');
                                     halt;
                                    end;
  if (g=1) and (r>1) and (b=0) then begin
                                     writeln('BG');
                                     halt;
                                    end;
  if (r=1) and (g=0) and (b>1) then begin
                                     writeln('GR');
                                     halt;
                                    end;
  if (r=1) and (b=0) and (g>1) then begin
                                     writeln('BR');
                                     halt;
                                    end;
  if (b=1) and (g=0) and (r>1) then begin
                                     writeln('BG');
                                     halt;
                                    end;
  if (b=1) and (g>1) and (r=0) then begin
                                     writeln('BR');
                                     halt;
                                    end;
end.

var
  a, c, r, g, b, i: int64;
  ar: array [1..1000] of char;
  q1, q2, q3: boolean;

procedure rek(a, r, g, b: int64);
begin
  if a = 1 then begin
    if r = 1 then q1 := true;
    if g = 1 then q2 := true;
    if b = 1 then q3 := true;
    exit;
  end;
  if b > 1 then rek(a - 1, r, g, b - 1);
  if (b > 0) and (r > 0) then rek(a - 1, r - 1, g + 1, b - 1);
  if (b > 0) and (g > 0) then rek(a - 1, r + 1, b - 1, g - 1);
  if r > 1 then rek(a - 1, r - 1, g, b);
  if (r > 0) and (g > 0) then rek(a - 1, r - 1, g - 1, b + 1);
  if g > 1 then rek(a - 1, r, g - 1, b);
end;

begin
  readln(a);
  i := 1;
  while i <= a do begin
    read(ar[i]);
    if ar[i] = 'R' then inc(r);
    if ar[i] = 'G' then inc(g);
    if ar[i] = 'B' then inc(b);
    inc(i);
  end;
  if (r > 0) and (g > 0) and (b > 0) then begin
    q1 := true;
    q2 := true;
    q3 := true;
  end
  else if (r >= 2) and (g >= 2) then begin
    q1 := true;
    q2 := true;
    q3 := true;
  end
  else if (r >= 2) and (b >= 2) then begin
    q1 := true;
    q2 := true;
    q3 := true;
  end
  else if (g >= 2) and (b >= 2) then begin
    q1 := true;
    q2 := true;
    q3 := true;
  end
  else if (r = 1) and (g > 1) then begin
    q1 := true;
    q3 := true;
  end
  else if (r = 1) and (b > 1) then begin
    q1 := true;
    q2 := true;
  end
  else if (g = 1) and (r > 1) then begin
    q2 := true;
    q3 := true;
  end
  else if (g = 1) and (b > 1) then begin
    q2 := true;
    q1 := true;
  end
  else if (b = 1) and (r > 1) then begin
    q3 := true;
    q2 := true;
  end
  else if (b = 1) and (g > 1) then begin
    q3 := true;
    q1 := true;
  end
  else if (r = 1) and (g = 1) then q3 := true
  else if (r = 1) and (b = 1) then q2 := true
  else if (g = 1) and (b = 1) then q1 := true
  else if (r > 0) then q1 := true
  else if (g > 0) then q2 := true
  else if (b > 0) then q3 := true;
  if q3 then write('B');
  if q1 then write('R');
  if q2 then write('G');
end.

var
  a, c, r, g, b, i: int64;
  ar: array [1..1000] of char;
  q1, q2, q3: boolean;

procedure rek(a, r, g, b: int64);
begin
  if a = 1 then begin
    if r = 1 then q1 := true;
    if g = 1 then q2 := true;
    if b = 1 then q3 := true;
    exit;
  end;
  if b > 1 then rek(a - 1, r, g, b - 1);
  if (b > 0) and (r > 0) then rek(a - 1, r - 1, g + 1, b - 1);
  if (b > 0) and (g > 0) then rek(a - 1, r + 1, b - 1, g - 1);
  if r > 1 then rek(a - 1, r - 1, g, b);
  if (r > 0) and (g > 0) then rek(a - 1, r - 1, g - 1, b + 1);
  if g > 1 then rek(a - 1, r, g - 1, b);
end;

begin
  readln(a);
  i := 1;
  while i <= a do begin
    read(ar[i]);
    if ar[i] = 'R' then inc(r);
    if ar[i] = 'G' then inc(g);
    if ar[i] = 'B' then inc(b);
    inc(i);
  end;
  rek(a, r, g, b);
  if q1 then write('R');
  if q2 then write('G');
  if q3 then write('B');
end.

var i,n,j,x,y,t,kol,R,B,G:longint;
s,sn:string;
begin
readln(n);
readln(s);
for i:=1 to length(s) do
begin
if (s[i]='R') then inc(r);
if (s[i]='B') then inc(b);
if (s[i]='G') then inc(g);
end;

if (R>0)and(B>0)and(g>0) then
begin
writeln('BGR');
halt;
end;

if ((r>1)and(b>1))or
   ((r>1)and(g>1))or
   ((g>1)and(b>1)) then
begin
writeln('BGR');
halt;
end;

if (r>1)and(b=1) then writeln('BG') else
if (r=1)and(b>1) then writeln('GR') else
if (r=1)and(b=1) then writeln('G') else

if (r>1)and(g=1) then writeln('BG') else
if (r=1)and(g>1) then writeln('BR') else
if (r=1)and(g=1) then writeln('B') else

if (g>1)and(b=1) then writeln('BR') else
if (g=1)and(b>1) then writeln('GR') else
if (g=1)and(b=1) then writeln('R') else
if (g>1) then writelN('G') else
if (b>1) then writeln('B') else
if (r>1) then writeln('R');

end.

var i,n,r,g,b:longint;
    c:char;
begin
readln(n);
for i:=1 to n do
   begin
   read(c);
   case c of
   'R':inc(r);
   'G':inc(g);
   'B':inc(b);
   end end;
if ((r>0)and(g>0)and(b>0))or((r>1)and(g>1)or(r>1)and(b>1)or(b>1)and(g>1))then write('RGB') else
   if (r=0)and(g=0) then write('B') else
   if (r=0)and(b=0) then write('G') else
   if (g=0)and(b=0) then write('R') else
   if (r>1) then write('GB') else
   if (g>1) then write('RB') else
   if (b>1) then write('RG') else
   if n=2 then if g=0 then write('G') else if b=0 then write('B') else write('R');
end.

var r, g, b, n, i, j, t:longint;
s:string;
a:array[1..3] of longint;
begin
  readln(n);
  read(s);
  r := 0; b := 0; g := 0;
  for i := 1 to n do begin
    if s[i] = 'R' then r := r + 1;
    if s[i] = 'G' then g := g + 1;
    if s[i] = 'B' then b := b + 1;
  end;
  if r > 3 then r := 2;
  if g > 3 then g := 2;
  if b > 3 then b := 2;
  a[1] := r; a[2] := g; a[3] := b;
  for i := 1 to 3 do for j := 1 to 3 do if (a[i] < a[j]) and (i > j) then begin t := a[i]; a[i] := a[j]; a[j] := t; end;
  //writeln(a[1], ' ', a[2], ' ', a[3]);
  if a[1] > 1 then begin
    writeln('BGR');
    exit;
  end;
  if (a[1] = 0) and (a[2] = 2) then begin
    writeln('BGR');
    exit;
  end;
  if (a[1] = 0) and (a[2] = 1) and (a[3] = 2) then begin
    if (b = 1) or (b = 0) then write('B'); if (g = 1) or (g = 0) then write('G'); if (r = 1) or (r = 0) then write('R');
    exit;
  end;
  if (a[1] = 0) and (a[2] = 1) and (a[3] = 1) then begin
    if (b = 0) then write('B'); if (g = 0) then write('G'); if (r = 0) then write('R');
    exit;
  end;
  if (a[1] = 0) and (a[2] = 0) and (a[3] > 0) then begin
    if b > 0 then write('B'); if g > 0 then write('G'); if r > 0 then write('R');
    exit;
  end;
end.

var r, g, b, n, i, j, t:longint;
s:string;
a:array[1..3] of longint;
begin
  readln(n);
  read(s);
  r := 0; b := 0; g := 0;
  for i := 1 to n do begin
    if s[i] = 'R' then r := r + 1;
    if s[i] = 'G' then g := g + 1;
    if s[i] = 'B' then b := b + 1;
  end;
  if r > 3 then r := 2;
  if g > 3 then g := 2;
  if b > 3 then b := 2;
  a[1] := r; a[2] := g; a[3] := b;
  for i := 1 to 3 do for j := 1 to 3 do if (a[i] < a[j]) and (i > j) then begin t := a[i]; a[i] := a[j]; a[j] := t; end;
  //writeln(a[1], ' ', a[2], ' ', a[3]);
  if a[1] > 1 then begin
    writeln('BGR');
    exit;
  end;
  if (a[1] = 0) and (a[2] = 2) then begin
    writeln('BGR');
    exit;
  end;
  if (a[1] = 0) and (a[2] = 1) and (a[3] = 2) then begin
    if (b = 1) or (b = 0) then write('B'); if (g = 1) or (g = 0) then write('G'); if (r = 1) or (r = 0) then write('R');
    exit;
  end;
  if (a[1] = 0) and (a[2] = 1) and (a[3] = 1) then begin
    if (b = 0) then write('B'); if (g = 0) then write('G'); if (r = 0) then write('R');
    exit;
  end;
  if (a[1] = 0) and (a[2] = 0) and (a[3] > 0) then begin
    if b > 0 then write('B'); if g > 0 then write('B'); if r > 0 then write('B');
    exit;
  end;
end.

program z1;
var s,res:ansistring;
n,a,b,c,i,k:longint;
begin
readln(n);
readln(s);
for i:=1 to n do begin
                 if s[i]='B' then inc(a);
                 if s[i]='G' then inc(b);
                 if s[i]='R' then inc(c);
                 if ((a>0) and (b>0) and (c>0)) or ((a>1) and (b>1)) or ((a>1) and (c>1)) or ((b>1) and (c>1)) then begin
                                                   write('BGR');
                                                   halt
                                                   end
                 end;
if (a=0) and (b=0) then begin
                        write('R');
                        halt
                        end;
if (a=0) and (c=0) then begin
                        write('G');
                        halt
                        end;
if (c=0) and (b=0) then begin
                        write('B');
                        halt
                        end;
if a=1 then begin
            if b<>0 then write('BR')
                    else write('BG');
            halt
            end;
if b=1 then begin
            if c<>0 then write('BG')
                    else write('GR');
            halt
            end;
if c=1 then begin
            if b<>0 then write('BK')
                    else write('GR');
            halt
            end;
end.

program z1;
var s,res:ansistring;
n,a,b,c,i,k:longint;
begin
readln(n);
readln(s);
for i:=1 to n do begin
                 if s[i]='B' then inc(a);
                 if s[i]='G' then inc(b);
                 if s[i]='R' then inc(c);
                 if ((a>0) and (b>0) and (c>0)) or ((a>1) and (b>1)) or ((a>1) and (c>1)) or ((b>1) and (c>1)) then begin
                                                   write('BGR');
                                                   halt
                                                   end
                 end;
if (a=0) and (b=0) then begin
                        write('R');
                        halt
                        end;
if (a=0) and (c=0) then begin
                        write('G');
                        halt
                        end;
if (c=0) and (b=0) then begin
                        write('B');
                        halt
                        end;
if (a=1) and (b=1) then begin
                        write('R');
                        halt
                        end;
if (a=1) and (c=1) then begin
                        write('G');
                        halt
                        end;
if (c=1) and (b=1) then begin
                        write('B');
                        halt
                        end;
if a=1 then begin
            if b<>0 then write('BR')
                    else write('BG');
            halt
            end;
if b=1 then begin
            if c<>0 then write('BG')
                    else write('GR');
            halt
            end;
if c=1 then begin
            if b<>0 then write('BG')
                    else write('GR');
            halt
            end;
End.

Program Buntarik;
var n,a,b,c,i:longint;
s:string;
begin
{assign(input,'input.txt');
reset(input);
assign(output,'output.txt');
rewrite(output);}

readln(n);
readln(s);
for i:=1 to n do
if s[i]='B'
then inc(a)
else if s[i]='R'
then inc(b)
else inc(c);
if n=1
then begin writeln(s); halt; end;

if (a>1)and(b>1)and(c>1)or(a>2)and(b>2)or(c>2)and(b>2)or(a>2)and(c>2)
then writeln('GBR')
else
if (a>1)and(b=1)and(c=0)or(a>1)and(b=0)and(c=1)
then writeln('GR')
else
if (a=1)and(b>1)and(c=0)or(a=0)and(b>1)and(c=0)
then writeln('BG')
else
if (a=1)and(b=0)and(c>1)or(a=0)and(b=1)and(c>1)
then writeln('BR')
else if (a>1)and(b=0)and(c=0)or(a=0)and(b=1)and(c=1)
then writeln('B')
else if (a=0)and(b>1)and(c=0)or(a=1)and(b=0)and(c=1)
then writeln('R')
else if (a=0)and(b=0)and(c>1)or(a=1)and(b=1)and(c=0)
then writeln('G');

{close(input);
close(output); }
end.

Program Buntarik;
var n,a,b,c,i:longint;
s:string;
begin
{assign(input,'input.txt');
reset(input);
assign(output,'output.txt');
rewrite(output);}

readln(n);
readln(s);
for i:=1 to n do
if s[i]='B'
then inc(a)
else if s[i]='R'
then inc(b)
else inc(c);
if n=1
then begin writeln(s); halt; end;

if (a>0)and(b>0)and(c>0)or(a>1)and(b>1)or(c>1)and(b>1)or(a>1)and(c>1)
then writeln('BGR')
else
if (a>1)and(b=1)and(c=0)or(a>1)and(b=0)and(c=1)
then writeln('GR')
else
if (a=1)and(b>1)and(c=0)or(a=0)and(b>1)and(c=0)
then writeln('BG')
else
if (a=1)and(b=0)and(c>1)or(a=0)and(b=1)and(c>1)
then writeln('BR')
else if (a>1)and(b=0)and(c=0)or(a=0)and(b=1)and(c=1)
then writeln('B')
else if (a=0)and(b>1)and(c=0)or(a=1)and(b=0)and(c=1)
then writeln('R')
else if (a=0)and(b=0)and(c>1)or(a=1)and(b=1)and(c=0)
then writeln('G');

{close(input);
close(output);}
end.

Program Buntarik;
var n,a,b,c,i:longint;
s:string;
begin
{assign(input,'input.txt');
reset(input);
assign(output,'output.txt');
rewrite(output);}

readln(n);
readln(s);
for i:=1 to n do
if s[i]='B'
then inc(a)
else if s[i]='R'
then inc(b)
else inc(c);
if n=1
then begin writeln(s); halt; end;

if (a>1)and(b>1)and(c>1)or(a>2)and(b>2)or(c>2)and(b>2)or(a>2)and(c>2)
then writeln('BGR')
else
if (a>1)and(b=1)and(c=0)or(a>1)and(b=0)and(c=1)
then writeln('GR')
else
if (a=1)and(b>1)and(c=0)or(a=0)and(b>1)and(c=0)
then writeln('BG')
else
if (a=1)and(b=0)and(c>1)or(a=0)and(b=1)and(c>1)
then writeln('BR')
else if (a>1)and(b=0)and(c=0)or(a=0)and(b=1)and(c=1)
then writeln('B')
else if (a=0)and(b>1)and(c=0)or(a=1)and(b=0)and(c=1)
then writeln('R')
else if (a=0)and(b=0)and(c>1)or(a=1)and(b=1)and(c=0)
then writeln('G');

{close(input);
close(output); }
end.

var
 N,i,B,R,G:longint;
 ch:char;
 f:boolean;

begin
 readln(n);
 b:=0;
 r:=0;
 g:=0;

 for i:=1 to N do begin
  read(ch);
  if(ch='B') then inc(b);
  if(ch='R') then inc(r);
  if(ch='G') then inc(g);
 end;

 if(r>=2)and(g>=2)or(r>=2)and(b>=2)and(g>=2)and(b>=2)or(b*r*g<>0) then write('BGR')
 else begin
  f:=true;
  if(g=1)and(b>=2)and(f) then begin write('GR');f:=false;end;
  if(g=1)and(r>=2)and(f) then begin write('BG');f:=false;end;
  if(r=1)and(b>=2)and(f) then begin write('GR');f:=false;end;
  if(r=1)and(g>=2)and(f) then begin write('BR');f:=false;end;
  if(b=1)and(r>=2)and(f) then begin write('BR');f:=false;end;
  if(b=1)and(g>=2)and(f) then begin write('BG');f:=false;end;

  if(b>0)and(r>0)and(f) then write('G');
  if(b>0)and(g>0)and(f) then write('R');
  if(r>0)and(g>0)and(f) then write('B');

  if(b=n) then write('B');
  if(r=n) then write('R');
  if(g=n) then write('G');
 end;

end.

var
  s : ansistring;
  n,r,b,g,i : longint;

  function chk(x,y,z : longint) : boolean;
    begin
      if (x > 0) and (y > 0) and (z > 0) then exit(true);
      if (y+z = 0) then exit(true);
      if (x = 0) then begin
        if (y > 0) and (z > 0) then exit(true);
      end;
      if (y = 0) then begin
        if (x > 0) and (z > 1) then exit(true);
      end;
      if (z = 0) then begin
        if (x > 0) and (y > 1) then exit(true);
      end;
      exit(false);
    end;

begin
  readln(n);
  readln(s);
  for i:=1 to n do begin
    if s[i] = 'R' then inc(r);
    if s[i] = 'G' then inc(g);
    if s[i] = 'B' then inc(b);
  end;
  if chk(r,g,b) then write('R');
  if chk(g,r,b) then write('G');
  if chk(b,r,g) then write('B');
  writeln;
end.

{$mode objfpc}
CONST
    ip              = '';//'card.inp';
    op              = '';//'card.out';
VAR
    n               : LongInt;
    b,g,r           : LongInt;
    s,t             : AnsiString;

procedure INPUT;
var
    f               : Text;
begin
    assign(f,ip); reset(f);
    readln(f,n);
    readln(f,s);
    close(f);
end;

function check(a,b,c : LongInt) :BooLean;
begin
    if (a >= 1) and (b < 1) and (c < 1) then exit(true);
    if (a >= 1) and ((b >1) or (c > 1)) then exit(true);
    if (a = 0) and (b >= 1) and  (c >= 1) then exit(true);
    exit(false);
end;

procedure SOLVE;
var
    i,j             : Longint;
begin
    for i := 1 to n do
        case s[i] of
            'B' : inc(b);
            'G' : inc(g);
            'R' : inc(r);
        end;
end;

procedure OUTPUT;
var
    f           : Text;
    i           : LongInt;
begin
    assign(f,op); rewrite(f);
    if check(b,g,r) then write(f,'B');
    if check(g,b,r) then write(f,'G');
    if check(r,b,g) then write(f,'R');
    close(f);
end;

BEGIN
    INPUT;
    SOLVE;
    OUTPUT;
END.

var
    n, i, g, b, r: Integer;
    s: string;

begin
    ReadLn (n);
    ReadLn (s);

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

    for i:= 1 to Length (s) do
        if s[i] = 'G' then
            Inc (g)
        else if s[i] = 'B' then
            Inc (b)
        else if s[i] = 'R' then
            Inc (r);

    if (b = 0) and ((r = 0) or (g = 0)) then
    else if (b >= 1) and (r + g = 1) then
    else Write ('B');

    if (g = 0) and ((r = 0) or (b = 0)) then
    else if (g >= 1) and (r + b = 1) then
    else Write ('G');

    if (r = 0) and ((b = 0) or (g = 0)) then
    else if (b >= 1) and (b + g = 1) then
    else Write ('R')
end.

uses math;
var
 a,t1,t2,t3,r:array[0..100000]of longint;
 s,ss:ansistring;
 i,m,n,k,l,w,j,p1,p2,p3:longint;
begin
 readln(n);
 readln(s);
 for i:=1 to n do
 begin
  if s[i]='B' then inc(a[1]);
  if s[i]='G' then inc(a[2]);
  if s[i]='R' then inc(a[3]);
 end;

 if (a[1]<>0) then
 begin
  if max(a[2],a[3])mod 2=0 then r[1]:=1;
 end;
 if a[1]=0 then
 begin
  if (a[2]<>0)and(a[3]<>0) then r[1]:=1;
 end;

 if (a[2]<>0) then
 begin
  if max(a[1],a[3])mod 2=0 then r[2]:=1;
 end;
 if a[2]=0 then
 begin
  if (a[1]<>0)and(a[3]<>0) then r[2]:=1;
 end;

 if (a[3]<>0) then
 begin
  if max(a[2],a[1])mod 2=0 then r[3]:=1;
 end;
 if a[3]=0 then
 begin
  if (a[2]<>0)and(a[1]<>0) then r[3]:=1;
 end;
 if r[1]=1 then write('B');
 if r[2]=1 then write('G');
 if r[3]=1 then write('R');
end.

var
 a,t1,t2,t3,r:array[0..100000]of longint;
 s,ss:ansistring;
 i,m,n,k,l,w,j,p1,p2,p3:longint;
begin
 readln(n);
 readln(s);
 for i:=1 to n do
 begin
  if s[i]='B' then inc(a[1]);
  if s[i]='G' then inc(a[2]);
  if s[i]='R' then inc(a[3]);
 end;

 if (a[1]<>0) then
 begin
  if (a[2]+a[3])mod 2=0 then r[1]:=1;
 end;
 if a[1]=0 then
 begin
  if (a[2]<>0)and(a[3]<>0) then r[1]:=1;
 end;

 if (a[2]<>0) then
 begin
  if (a[1]+a[3])mod 2=0 then r[2]:=1;
 end;
 if a[2]=0 then
 begin
  if (a[1]<>0)and(a[3]<>0) then r[2]:=1;
 end;

 if (a[3]<>0) then
 begin
  if (a[2]+a[1])mod 2=0 then r[3]:=1;
 end;
 if a[3]=0 then
 begin
  if (a[2]<>0)and(a[1]<>0) then r[3]:=1;
 end;
 if r[1]=1 then write('B');
 if r[2]=1 then write('G');
 if r[3]=1 then write('R');
end.

uses math;
var
 a,t1,t2,t3,r:array[0..100000]of longint;
 s,ss:ansistring;
 i,m,n,k,l,w,j,p1,p2,p3:longint;
begin
 readln(n);
 readln(s);
 for i:=1 to n do
 begin
  if s[i]='B' then inc(a[1]);
  if s[i]='G' then inc(a[2]);
  if s[i]='R' then inc(a[3]);
 end;

 if (a[1]<>0) then
 begin
  if a[2]+a[3]>1 then r[1]:=1;
 end;
 if a[1]=0 then
 begin
  if (a[2]<>0)and(a[3]<>0) then r[1]:=1;
 end;

 if (a[2]<>0) then
 begin
  if a[1]+a[3]>1 then r[2]:=1;
 end;
 if a[2]=0 then
 begin
  if (a[1]<>0)and(a[3]<>0) then r[2]:=1;
 end;

 if (a[3]<>0) then
 begin
  if a[1]+a[2]>1 then r[3]:=1;
 end;
 if a[3]=0 then
 begin
  if (a[2]<>0)and(a[1]<>0) then r[3]:=1;
 end;
 if r[1]=1 then write('B');
 if r[2]=1 then write('G');
 if r[3]=1 then write('R');
end.

var s:string;
    n,i,kg,kb,kr:longint;
begin
readln(n);
readln(s);
for i:=1 to n do
begin
if s[i]='G' then
inc(kg);
if s[i]='B' then
inc(kb);
if s[i]='R' then
inc(kr);
end;
if (kg<>0) and (kb<>0) and (kr<>0) then
begin
writeln('GBR');
halt;
end;
if ((kg>=2) and (kb>=2)) or ((kr>=2) and (kb>=2)) or ((kg>=2) and (kr>=2)) then
begin
writeln('GBR');
halt;
end;
if (kg>=2) and ((kr=1) or (kb=1)) then
begin
writeln('RB');
halt;
end;
if (kr>=2) and ((kb=1) or (kg=1)) then
begin
writeln('GB');
halt;
end;
if (kb>=2) and ((kr=1) or (kg=1)) then
begin
writeln('GR');
halt;
end;
if (kg=1) and (kr=1) then
begin
writeln('B');
halt;
end;
if (kg=1) and (kb=1) then
begin
writeln('R');
halt;
end;
if (kr=1) and (kb=1) then
begin
writeln('G');
halt;
end;
if (kg>=1) then
begin
writeln('G');
halt;
end;
if (kb>=1) then
begin
writeln('B');
halt;
end;
if (kr>=1) then
begin
writeln('R');
halt;
end;
end.

var s:string;
    n,i,kg,kb,kr:longint;
begin
readln(n);
readln(s);
for i:=1 to n do
begin
if s[i]='G' then
inc(kg);
if s[i]='B' then
inc(kb);
if s[i]='R' then
inc(kr);
end;
if (kg<>0) and (kb<>0) and (kr<>0) then
begin
writeln('GBR');
halt;
end;
if ((kg>=2) and (kb>=2)) or ((kr>=2) and (kb>=2)) or ((kg>=2) and (kr>=2)) then
begin
writeln('GBR');
halt;
end;
if (kg>=2) and ((kr=1) or (kb=1)) then
begin
writeln('BR');
halt;
end;
if (kr>=2) and ((kb=1) or (kg=1)) then
begin
writeln('GB');
halt;
end;
if (kb>=2) and ((kr=1) or (kg=1)) then
begin
writeln('GR');
halt;
end;
if (kg=1) and (kr=1) then
begin
writeln('B');
halt;
end;
if (kg=1) and (kb=1) then
begin
writeln('R');
halt;
end;
if (kr=1) and (kb=1) then
begin
writeln('G');
halt;
end;
if (kg>=1) then
begin
writeln('G');
halt;
end;
if (kb>=1) then
begin
writeln('B');
halt;
end;
if (kr>=1) then
begin
writeln('R');
halt;
end;
end.

var B,G,R,i,n:longint;
s:string;
begin
  readln(n);
  readln(s);
  for i:=1 to n do
    if s[i]='B' then B:=B+1
    else if s[i]='G' then G:=G+1
    else R:=R+1;
  if (B>0)and(G>0)and(R>0)then begin
                                 writeln('BGR');
                                 halt;
                               end
  else if (B=0)and(G=0)then begin
                              writeln('R');
                              halt;
                            end
  else if (B=0)and(R=0)then begin
                              writeln('G');
                              halt;
                            end
  else if (G=0)and(R=0)then begin
                              writeln('B');
                              halt;
                            end
  else if B=G then writeln('R')
  else if B=R then writeln('G')
  else if G=R then writeln('B')
  else if B=0 then begin
                     write('B');
                     if R<G then write('R')
                            else write('G');
                     halt;
                   end
  else if G=0 then begin
                     if B<R then begin
                                   write('B');
                                   write('G');
                                 end
                            else begin
                                   write('G');
                                   write('R');
                                 end;
                     halt;
                   end
  else if R=0 then begin
                     if B<G then write('B')
                            else write('G');
                     write('R');
                     halt;
                   end;
end.

{$mode objfpc}
uses
	math;

var
	fi: text;
	i, j, n, cnt: integer;
	s: ansistring;
	check: array['A'..'Z'] of integer;
	c, last: char;
	res: ansistring;
begin
	assign(fi, ''); reset(fi);
	readln(fi, n); readln(fi, s);
	for i := 1 to n do begin
		if check[s[i]] = 0 then
			inc(cnt);
		inc(check[s[i]]);
		last := s[i];
	end;

	for i := 1 to n do for j := i+1 to n do
		if s[i] > s[j] then begin
			c:= s[i]; s[i] := s[j]; s[j] := c;
		end;
	//
	if (cnt >= 2) and (check['R'] + check['G']  + check['B'] > 3) then begin
		writeln('BGR'); exit
	end;

	if cnt = 1 then begin
		writeln(last); exit
	end;

	if cnt = 3 then begin
		writeln('BGR'); exit
	end;
	//

	if (cnt = 2) and (n = 2) then begin
		if (check['B']>0) and (check['R'] > 0) then writeln('G')
		else if (check['B'] =1) and (check['G']=1) then writeln('R')
		else if (check['G'] = 1) and (check['R']=1) then writeln('B');
	end;

	res := '';
	//writeln(cnt);
	if (cnt = 2) and (n > 2) then begin
		for i := 1 to n do
			if check[s[i]] > 1 then begin
				res := res + s[i];
				if length(Res) = 2 then break
			end;
	//	writeln(res);
		if res = 'GG' then writeln('BR');
		if res = 'RR' then writeln('BG');
		if res = 'BB' then writeln('GR');
	end;

end.

{$mode objfpc}
uses
	math;

var
	fi: text;
	i, j, n, cnt: integer;
	s: ansistring;
	check: array['A'..'Z'] of integer;
	c, last: char;
	res: ansistring;
begin
	assign(fi, ''); reset(fi);
	readln(fi, n); readln(fi, s);
	for i := 1 to n do begin
		if check[s[i]] = 0 then
			inc(cnt);
		inc(check[s[i]]);
		last := s[i];
	end;

	for i := 1 to n do for j := i+1 to n do
		if s[i] > s[j] then begin
			c:= s[i]; s[i] := s[j]; s[j] := c;
		end;
	//
	if (check['R'] + check['G']  + check['B'] > 3) then begin
		writeln('BGR'); exit
	end;

	if cnt = 1 then begin
		writeln(last); exit
	end;

	if cnt = 3 then begin
		writeln('BGR'); exit
	end;
	//

	if (cnt = 2) and (n = 2) then begin
		if (check['B']>0) and (check['R'] > 0) then writeln('G')
		else if (check['B'] =1) and (check['G']=1) then writeln('R')
		else if (check['G'] = 1) and (check['R']=1) then writeln('B');
	end;

	res := '';
	//writeln(cnt);
	if (cnt = 2) and (n > 2) then begin
		for i := 1 to n do
			if check[s[i]] > 1 then begin
				res := res + s[i];
				if length(Res) = 2 then break
			end;
	//	writeln(res);
		if res = 'GG' then writeln('BR');
		if res = 'RR' then writeln('BG');
		if res = 'BB' then writeln('GR');
	end;

end.

{$mode objfpc}
uses
	math;

var
	fi: text;
	i, j, n, cnt: integer;
	s: ansistring;
	check: array['A'..'Z'] of integer;
	c, last: char;
	res: ansistring;
begin
	assign(fi, ''); reset(fi);
	readln(fi, n); readln(fi, s);
	for i := 1 to n do begin
		if check[s[i]] = 0 then
			inc(cnt);
		inc(check[s[i]]);
		last := s[i];
	end;

	for i := 1 to n do for j := i+1 to n do
		if s[i] > s[j] then begin
			c:= s[i]; s[i] := s[j]; s[j] := c;
		end;
	//
	if cnt = 1 then begin
		writeln(last); exit
	end;

	if cnt = 3 then begin
		writeln('BGR'); exit
	end;
	//

	if (cnt = 2) and (n = 2) then begin
		if (check['B']>0) and (check['R'] > 0) then writeln('G')
		else if (check['B'] =1) and (check['G']=1) then writeln('R')
		else if (check['G'] = 1) and (check['R']=1) then writeln('B');
	end;

	res := '';
	//writeln(cnt);
	if (cnt = 2) and (n > 2) then begin
		for i := 1 to n do
			if check[s[i]] > 1 then begin
				res := res + s[i];
				if length(Res) = 2 then break
			end;
	//	writeln(res);
		if res = 'GG' then writeln('BR');
		if res = 'RR' then writeln('BG');
		if res = 'BB' then writeln('GR');
	end;

end.

{$mode objfpc}
uses
	math;

var
	fi: text;
	i, j, n, cnt: integer;
	s: ansistring;
	check: array['A'..'Z'] of integer;
	c, last: char;
	res: ansistring;
begin
	assign(fi, ''); reset(fi);
	readln(fi, n); readln(fi, s);
	for i := 1 to n do begin
		if check[s[i]] = 0 then
			inc(cnt);
		inc(check[s[i]]);
		last := s[i];
	end;
	for i := 1 to n do for j := i+1 to n do
		if s[i] > s[j] then begin
			c:= s[i]; s[i] := s[j]; s[j] := c;
		end;

	//
	if cnt = 1 then begin
		writeln(last); exit
	end;

	if cnt = 3 then begin
		writeln('BGR'); exit
	end;
	//

	if (cnt = 2) and (n = 2) then begin
		if (check['B']>0) and (check['R'] > 0) then writeln('G')
		else if (check['B'] =1) and (check['G']=1) then writeln('R')
		else if (check['G'] = 1) and (check['R']=1) then writeln('B');
	end;

	res := '';
	if (cnt = 2) and (n > 2) then begin
		for i := 1 to n do
			if check[s[i]] > 1 then res := res + s[i];
		if res = 'GG' then writeln('BR');
		if res = 'RR' then writeln('BG');
		if res = 'BB' then writeln('GR');
	end;

end.

uses math;
var b,g,r,bs,gs,rs,i,j,n,k,m,s:longint;
    h:char;

begin
    readln(n);
    for i:=1 to n do
    begin
        read(h);
        if h = 'R' then inc(rs) else
        if h = 'B' then inc(bs) else
                        inc(gs);
    end;

    b:=bs; g:=gs; r:=rs;

  //  while b+g+r > 2 do
//    begin
        if g > 0 then g:=1;
        if b > 0 then b:=1;
        if r > 0 then r:=1;
//    end;

    if (g+r=2) or (g+r=0) then write('B');
    if (r+b=2) or (r+b=0) then write('G');
    if (g+b=2) or (g+b=0) then write('R');
end.

var
podr,podb,podg,min,n,i,r,g,b:longint;
s:string;
begin
readln(n);
readln(s);
for i:=1 to n do begin
    if s[i]='R' then inc(r);
    if s[i]='B' then inc(b);
    if s[i]='G' then inc(g);
end;
if ((r>0)and(b>0)and(g>0))or((r>=2)and(b>=2))or((r>=2)and(g>=2))or((g>=2)and(b>=2)) then write('BGR')
else
begin
    if (r>=1)and(b=0)and(g=0) then write('R')
    else
    if (r=0)and(b>=1)and(g=0) then write('B')
    else
    if (r=0)and(b>=0)and(g=1) then write('G')
    else
    if (r=1)and(b=1)and(g=0) then write('G')
    else
    if (r=1)and(b=0)and(g=1) then write('B')
    else
    if (r=0)and(b=1)and(g=1) then write('R')
    else
    if (r>=2)and(b=1)and(g=0) then write('BG')
    else
    if (r>=2)and(b=0)and(g=1) then write('BG')
    else
    if (r=1)and(b>=2)and(g=0) then write('GR')
    else
    if (r=1)and(b=0)and(g>=2) then write('BR')
    else
    if (r=0)and(b>=2)and(g=1) then write('GR')
    else
    if (r=0)and(b=1)and(g>=2) then write('BR');

end;
end.

{$mode objfpc}

var
 n,i,r,g,b:longint;
 s:ansistring;
procedure input;
begin
 readln(n);
 read(s);
end;

function tm(x,y,z:longint):boolean;
begin
 if (x=0) and (y>=1) and (z>=1) then exit(true);
 if (y=0) and (z=0) then exit(true);
 if (x>0) and ((y>1) or (z>1)) then exit(true);
 exit(false);
end;

procedure process;
begin
 r:=0;
 g:=0;
 b:=0;
 for i:=1 to length(s) do
  case s[i] of
   'R':inc(r);
   'G':inc(g);
   'B':inc(b);
  end;
 if tm(b,g,r) then write('B');
 if tm(g,r,b) then write('G');
 if tm(r,g,b) then write('R');
end;

begin
 input;
 process;
end.

var r,g,b:longint;
    n,i:integer;
    ch:char;
    r1,b1,g1:boolean;

label outp;

begin
  readln(n);
  for i:=1 to n do
    begin
      read(ch);
      case ch of
        'R': inc(r);
        'B': inc(b);
        'G': inc(g);
      end;
    end;
  if (r<>0)xor(g<>0)xor(b<>0)
    then
      begin
        if r<>0 then write('R');
        if b<>0 then write('B');
        if g<>0 then write('G');
      end
    else
      begin
        if ((r=1)xor(b=1)xor(g=1))and((r=0)xor(g=0)xor(b=0))
          then
            begin
              if b = 1 then b1:=true;
              if g = 1 then g1:=true;
              if r = 1 then r1:=true;
              if b = 0 then b1:=true;
              if g = 0 then g1:=true;
              if r = 0 then r1:=true;
              goto outp;
            end;

        if r+g+b = 2
          then
            begin
              if r=0 then write('R');
              if b=0 then write('B');
              if g=0 then write('G');
              exit;
            end;
        b1:=true;
        g1:=true;
        r1:=true;
        outp:
        if b1 then write('B');
        if g1 then write('G');
        if r1 then write('R');
      end;

end.

{$MODE OBJFPC}
program dream_hyojoo;
var    n,dem1,dem2,dem3,i:integer;
       s:ansistring;

begin
       //assign(input,'dream_hyojoo.inp');
       //reset(input);
       readln(n);
       readln(s);
       for i:=1 to n do
          begin
              if s[i]='B' then inc(dem1);
              if s[i]='G' then inc(dem2);
              if s[i]='R' then inc(dem3)
          end;
       if ((dem2>0) and (dem3>0)) or ((dem2=0) and (dem3=0)) then write('B');
       if ((dem1>0) and (dem3>0)) or ((dem1=0) and (dem3=0)) then write('G');
       if ((dem2>0) and (dem1>0)) or ((dem2=0) and (dem1=0)) then write('R');
       writeln

end.

{$MODE OBJFPC}
program dream_hyojoo;
var    n,dem1,dem2,dem3,i:integer;
       s:ansistring;

begin
       //assign(input,'dream_hyojoo.inp');
       //reset(input);
       readln(n);
       readln(s);
       for i:=1 to n do
          begin
              if s[i]='B' then inc(dem1);
              if s[i]='G' then inc(dem2);
              if s[i]='R' then inc(dem3)
          end;
       if (abs(dem2-dem3) mod 2=0) and (dem1>=abs(dem2-dem3) div 2)
          then write('B');
       if (abs(dem1-dem3) mod 2=0) and (dem2>=abs(dem1-dem3) div 2)
          then write('G');
       if (abs(dem2-dem1) mod 2=0) and (dem3>=abs(dem2-dem1) div 2)
          then write('R');
       writeln

end.

var  i, j, n, m:longint;
a:array[1..3]of longint;
s:string;
begin
readln(n);
read(s);
For i:=1 to n do  case s[i] of
                  'G':inc(a[2]);
                  'R':inc(a[3]);
                  'B':inc(a[1]);
                  end;
if (a[1]>0)and(a[2]>0)and(a[3]>0) then write('BGR')
    else if (a[1]=0)and(a[2]=0)then write('R')
        else if (a[2]=0)and(a[3]=0)then write('B')
            else if (a[1]=0)and(a[2]=0)then write('G')
                else  if a[1]=0 then begin if (a[2]>1)and(a[3]>1) then write('BGR')
                                                                  else
                                                                  if (a[3]=1)and(a[2]=1) then write('B')
                                                           else if a[2]=1 then write('BG')
                                                                          else if a[3]=1 then write('BR');
                                          end
                                     else
                           if a[2]=0 then begin if (a[1]>1)and(a[3]>1) then write('BGR')
                                                           else if (a[1]=1)and(a[3]=1) then write('G')
                                                           else if a[1]=1 then write('BG')
                                                                          else if a[3]=1 then write('GR');
                                          end
                                     else
                           if a[3]=0 then begin if (a[2]>1)and(a[1]>1) then write('BGR')
                                                           else if (a[1]=1)and(a[2]=1) then write('R')
                                                           else if a[2]=1 then write('GR')
                                                                          else if a[1]=1 then write('BR');
                                          end;

End.

var
  g, r, b:byte;
  c:char;
  i, n:byte;

BEGIN
  g:=0; r:=0; b:=0;
  readln(n);
  for i:=1 to n do begin
    read(c);
    if c='R' then
      inc(r)
    else if c='G' then
      inc(g)
    else
      inc(b);
  end;

  if r>=2 then begin
    if (b>=2) or (g>=2) then
      write('BGR')
    else if ((b>=1) and (g=0)) or ((b=0) and (g>=1)) then
      write('BG')
    else if (b=0) and (g=0) then
       write('R');
  end
  else if r>=1 then begin
    if (b>=1) and (g>=1) then
      write('BGR')
    else if ((b>=2) and (g=0)) then
      write('GR')
    else if ((b=0) and (g>=2))  then
      write('BR')
    else if (r=1) and (b=1) and (g=0) then
      write('G')
    else if (r=1) and (b=0) and (g=1) then
      write('B');
  end
  else if (b>=2) then  begin
    if g>=1 then
      write('GR')
    else if g=0 then
      write('B');
  end
  else if (b>=1) and (g>=2) then
    write('BR')
  else if (b=1) and (g=1) then
    write('R')
  else if g>=2 then
    write('G');

END.