const
  s='GBIV';

var
n,int1:longint;

begin
  readln(n);
  write('ROYGBIV');
  for int1:=8 to n do begin
    write(s[(int1 mod 4)+1]);
  end;
  writeln;
end.

Const color:array[1..4] of char = ('G','B','I','V');
Var A:array[1..101] of char;
     i,k,j,n:longint;
Begin
     Read(n);
     A[1]:='R';
     A[2]:='O';
     A[3]:='Y';
     i:=4;
     k:=n div 4;
     While i <= k*4 do
          For j:=1 to 4 do Begin
               A[i]:=color[j];
               i:=i+1;
          End;
     For j:=i to n do
          A[j] := color[j mod 4];
     For i:=1 to n do
          Write(A[i]);
End.

var n,i:longint;
begin
  readln(n);
  for i:=1 to n div 7 do
    write('ROYGBIV');
  if n mod 7=1
  then writeln('G')
  else if n mod 7=2
  then writeln('GB')
  else if n mod 7=3
  then writeln('GBI')
  else if n mod 7=4
  then writeln('ROYG')
  else if n mod 7=5
  then writeln('ROYGB')
  else if n mod 7=6
  then writeln('ROYGBI');
end.

var
  n:longint;
begin
  read(n);
  while (n>=10)do begin
    write('ROYGB');
    dec(n,5);
  end;
  if (n mod 5=2)then writeln('ROYGBIV')else
  if (n mod 5=3)then writeln('ROYGBIVG')else
  if (n mod 5=4)then writeln('ROYGBRIVG')else
  if (n mod 5=0)then writeln('ROYIV')else
  if (n mod 5=1)then writeln('ROYGIV');
end.

program d;
var
     a,b : array [1..111] of char;
       c : char;
i,j,n,i1 : integer;
       f : boolean;
BEGIN
b[1]:='R';
b[2]:='O';
b[3]:='Y';
b[4]:='G';
b[5]:='B';
b[6]:='I';
b[7]:='V';
readln (n);

for i:=1 to 7 do a[i]:=b[i];
for I:=8 to n do
   for i1:=1 to 7 do
        begin
	f:=false;
        for j:=1 to 3 do
               begin
               if i+j>n then c:=a[(i+j) mod n] else c:=a[i+j];
	       if (a[i-j]=b[i1]) or (c=b[i1]) then f:=true;
  	       end;
        if not f then a[i]:=b[i1];
	end;
for i:=1 to n do write (a[i]);

END.

const d:array[1..7]of char=('R','O','Y','G','B','I','V');
var n,i,j:integer;
ch:char;
begin
 readln(n);
 for i:=1 to 7 do
  write(d[i]);
 i:=8;
 while(i<=n)do begin
  j:=4;
  while((i<=n)and(j<=7))do begin
   write(d[j]);
   inc(j);inc(i);
  end;
 end;
end.

var
    c:array [1..7] of char;
    i,j,n,k:integer;
BEGIN
readln(n);
c[1]:='R';c[2]:='O';c[3]:='Y';c[4]:='G';c[5]:='B';c[6]:='I';c[7]:='V';

for i:=1 to n div 7 do
    for j:=1 to 7 do write(c[j]);
if (n mod 7 <=3) then for i:=1 to n  mod 7 do write(c[3+i])
    else for i:=1 to n mod 7 do write(c[i]);

END.

var  n,i,p:integer;
begin
read(n);
p:=n mod 7;
for i:=1 to (n div 7) do write('ROYGBIV');
if p=1 then write('G');
if p=2 then write('GB');
if p=3 then write('YGB');
if p=4 then write('YGBI');
if p=5 then write('OYGBI');
if p=6 then write('OYGBIV');
end.

var
	i, j, k, l, m, n : longint;
        s, p, r		 : string;
	a		 : array [1..7] of char;
	w		 : set of char;
begin
	readln(n);
	s := 'ROYGBIV';
        a[1] := 'R';
	a[2] := 'O';
	a[3] := 'Y';
	a[4] := 'G';
	a[5] := 'B';
	a[6] := 'I';
	a[7] := 'V';
	for k:=8 to n do
		begin
			p:=copy(s, length(s)-2, 3);
			r:=copy(s, 1, 3);
			for i:=1 to 7 do
				if (pos(a[i], p) = 0)and(pos(a[i], r) = 0) then
					begin
						s:=s+a[i];
						break;
					end;
		end;
	writeln(s);
end.

var n,i:integer;
begin
readln(n);
for i:=1 to n div 7 do write('ROYGBIV');
case n mod 7 of
1:write('G');
2:write('GB');
3:write('YGB');
4:write('YGBI');
5:write('OYGBI');
6:write('OYGBIV');
end;
end.

var n,m,j,i,k,l:longint;s1:string;

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

s1:='ROYGBIV';
for i:=8 to n do
s1:=s1+s1[i-4];

writeln(s1);

end.

var n,k,k1,i:integer;
    s,s1:ansistring;
begin
 read(n);
 s:='ROYGBIV';
 k:=n div 7;
 k1:=n mod 7;
 s1:='';
 for i:=1 to k do
  s1:=s1+s;
 case k1 of
  1: s1:=s1+'G';
  2: s1:=s1+'YG';
  3: s1:=s1+'YGB';
  4: s1:=s1+'YGBI';
  5: s1:=s1+'YGBIV';
  6: s1:=s1+'GBIVYG';end;
 write(s1);
end.

var
 a,c:array[0..101] of char;
 b:array[0..101] of longint;
 i,j,n:longint;
 s:string;

procedure sort;
 var
  i,j,m:longint;
  ch:char;
 begin
  for i:=1 to 6 do
   for j:=i+1 to 7 do
    if b[i]>b[j] then
     begin
      m:=b[i]; b[i]:=b[j]; b[j]:=m;
      ch:=c[i]; c[i]:=c[j]; c[j]:=ch;
     end;
 end;

function ok(i1,i:longint):boolean;
 var
  j,k:longint;
 begin
  for j:=1 to 3 do
   begin
    k:=i1+j;
    if k>n then k:=k mod n;
    if c[i]=a[k] then
     begin
      ok:=false;
      exit;
     end;
    k:=i1-j;
    if k<1 then k:=n+k;
    if c[i]=a[k] then
     begin
      ok:=false;
      exit;
     end;
   end;
  ok:=true;
 end;

begin
s:='ROYGBIV';
for i:=1 to 7 do
 begin
  b[i]:=0;
  c[i]:=s[i];
 end;
readln(n);
for i:=1 to n do a[i]:='a';
i:=0;
while i<n do
 begin
  sort;
  inc(i);
  j:=1;
  while not ok(i,j) do inc(j);
  a[i]:=c[j];
  inc(b[j]);
 end;
for i:=1 to n do write(a[i]);
end.

const fi = '';
        fo = '';
        C : array[1..7] of char = ('R','O','Y','G','B','I','V');
var
        f : text;
        n,i,j,k,min : longint;
        res : array[1..100] of char;
        A : array[1..6] of char;
        p : boolean;
        sl : array['A'..'Z'] of longint;
begin
        fillchar(sl,sizeof(sl),0);
        Assign(f,fi);
        reset(f);
        readln(f,n);
        Close(f);
        Assign(f,fo);
        rewrite(f);
        j := 0;
        Fillchar(res,sizeof(res),'Z');
        For i := 1 to 7 do
                res[i] := C[i];
        For i := 8 to n do
        Begin
                min := 1000000000;

                j := i;
                k := 0;
                repeat
                        dec(j);
                        inc(k);
                        if j = 0 then j := n;
                        A[k] := res[j];
                Until k = 3;
                j := i;
                Repeat
                        inc(j);
                        if j = n+1 then j := 1;
                        inc(k);
                        A[k] := res[j];
                Until k = 6;
                For k := 1 to 7 do
                begin
                        p := true;
                        For j := 1 to 6 do
                                if (C[k] = A[j])  then
                                Begin
                                        p := false;
                                        break;
                                End;
                        if p = true then break;
                End;
                res[i] := C[k];
        End;
        For i := 1 to n do
                Write(f,res[i]);
        Close(f);
End.

{
  Problem:
  Algorithm:
  Time:
}
const
  inf='input.txt';
  ouf='output.txt';

var
  n:longint;

Procedure AssignFile;
begin
  Assign(input,inf);
  Reset(input);
  Assign(output,ouf);
  Rewrite(output);
end;

Procedure CloseFile;
begin
  Close(input);
  Close(output);
end;

Procedure Init;
begin
  read(n);
end;

Procedure Main;
var
  i:longint;
begin
  //ROYGBIV
  for i:=1 to (n div 7) do Write('ROYGBIV');
  If (n mod 7)<>0 then
    Write(copy('GBIVGB',1,n mod 7));
  Writeln;
end;

begin
  //AssignFile;

  Init;
  Main;

  //CloseFile;
end.

program B70;
var mas:array [1..100] of byte;
    i,N,k,t:integer;
begin
 readln (N);
 i:=1;
 for i:=1 to 7 do
   mas[i]:=i;
 for k:=i+1 to N do
  begin
   mas[k]:=mas[k-4];
  end;
 for i:=1 to N do
  begin
   case mas[i] of
    4: write ('G');
    1: write ('R');
    2:write ('O');
    3:write ('Y');
    5:write ('B');
    6:write ('I');
    7:write ('V');
   end;
  end;
 halt (0);
end.

Program B78;
Var
  n,kol : longint;
  stas : char;

Begin

  readln(n);
   n:=n-7;
    write('ROYGBIV');
   stas:='V';
  kol:=1;

  while n<>0 do
   begin
    if stas='V' then stas:='G' else
     if stas='G' then stas:='B' else
      if stas='B' then stas:='I' else
       if stas='I' then stas:='V';
    write(stas);
     dec(n);
   end;

End.

var n,i: integer;
begin
     read(n);
     for i:=1 to n div 7 do write('ROYGBIV');
     n:=n mod 7;
     if n=6 then write('OYGBIV');
     if n=5 then write('YGBIV');
     if n=4 then write('GBIV');
     if n=3 then write('GBI');
     if n=2 then write('GB');
     if n=1 then write('G');
end.

Program z78b;
const cv:array[1..7]of char=('R','O','Y','G','B','I','V');
var n,i,k:byte;
begin
	read(n);
    for i:=1 to n div 7 do
    	write('ROYGBIV');
    k:=n mod 7;
    if k=1 then write('G');
    if k=2 then write('YG');
    if k=3 then write('OYG');
    if k=4 then write('ROYG');
    if k=5 then write('ROYGB');
    if k=6 then write('ROYGBI');
end.

const aa:array [1..7] of char =(('R'),('O'),('Y'),('G'),('B'),('I'),('V'));
var
  s:string;
  n,i,k,l:longint;
begin
  readln (n);
  k:=1;
  for i:=1 to n-3 do begin
    if k>7 then k:=1;
    if k<=7 then s:=s+aa[k];
    inc (k);
  end;
  k:=1;
  repeat
    l:=length (s);
    if k>7 then k:=1;
    if (s[l]<>aa[k]) and (s[l-1]<>aa[k]) and (s[l-2]<>aa[k]) and
      (s[1]<>aa[k]) and (s[2]<>aa[k]) and (s[3]<>aa[k]) and (k<=7) then
        s:=s+aa[k]  else inc (k);
    l:=length (s);
  until l=n;
  writeln (s);
end.

const
   arr:array[0..6] of char=('R','O','Y','G','B','I','V');
var
  n,r,i:longint;
begin
   readln(n);
   r:=n mod 7;
   if (r>3) or (r=0) then
     n:=n-1
   else
      if r>1 then
      begin
         for i:=r to 2*r-1 do
            write(arr[i]);
         n:=n-r-1;
      end
      else
      begin
         for i:=0 to 3 do
            write(arr[i]);
         write(arr[0]);
         for i:=4 to 6 do
            write(arr[i]);
         n:=n-9;
      end;
   for i:=0 to n do
        write(arr[i mod 7]);
   writeln;
end.

var   n,i,j:longint;
s,s1:string;
ch,ch1,ch2:char;
begin
{assign(input,'input.txt');
reset(input);
assign(output,'output.txt');
rewrite(output); }
read(n);
s:='';
s1:='VROYGBI';
for i:=1 to n do
 s:=s+s1[i mod 7+1];
if s[1]=s[n] then
 begin
  ch:=s[n];
  s[n]:=s[n-1];
  s[n-1]:=s[n-2];
  s[n-2]:=s[n-3];
  s[n-3]:=ch;
 end;
if n-(n div 7)*7=2 then
 begin
  ch:=s[n];
  ch1:=s[n-1];
  s[n]:=s[n-2];
  s[n-1]:=s[n-3];
  s[n-2]:=ch;
  s[n-3]:=ch1;
 end;
if n-(n div 7)*7=3 then
 begin
  ch:=s[n];
  ch1:=s[n-1];
  ch2:=s[n-2];
  s[n]:=s[n-3];
  s[n-1]:=ch;
  s[n-2]:=ch1;
  s[n-3]:=ch2;
 end;
write(s);
{close(input);
close(output);}
end.

program shablon;
{$O+ R-  Q-} {$ASSERTIONS ON} {$INLINE ON}
{$H+}
{$EXTENDEDSYNTAX ON SMARTLINK ON} { MEMORY SS, HS }
{$COperators ON} {$MACRO ON}
{$MODE OBJFPC}
{$DEFINE uu := for}

uses
 SysUtils,Math;

const inf=1/0;
      s='ROYGBIV';

type tpoint=record
      x,y:extended;
     end;

     tnode=record
      x,y,l,r,a,c:longint;
     end;

var x,y:extended;
    n:longint;
    ans:string;

{$IFNDEF ONLINE_JUDGE}
operator **(x,y:extended):extended;
begin
  result:=exp(ln(X)*Y);
end;
{$ENDIF}

procedure pout inline;
begin
 writeln(ans);
{$IFNDEF ONLINE_JUDGE}
 close(input);
 close(output);
{$ENDIF}
 halt(0);
end;

procedure pinit inline;
begin
{$IFNDEF ONLINE_JUDGE}
 assign(input,'input.txt');
 assign(output,'output.txt');
 reset(input);
 rewrite(output);
{$ENDIF}
 readln(n);
end;

procedure solve;
var i:longint;
begin
 ans:='';
 for i:=1 to 3 do
  ans+=s[i+4];
 for i:=4 to n do
  begin
   ans+=s[(i-1) mod 4 +1];
  end;
end;

begin
 pinit;
 solve;
 pout;
end.

var
i,n,j:integer;
s:string;
flag:boolean;
begin
  read(n);
  s:='ROYGBIV';
  for i:=8 to n do begin
    j:=4;
    flag:=true;
    while flag do begin

      if (s[j]<>s[1])and(s[j]<>s[2])and(s[j]<>s[3]) then begin
      if (s[j]<>s[length(s)])and(s[j]<>s[length(s)-1])and(s[j]<>s[length(s)-2]) then flag:=false;
      end;
      inc(j);
    end;
    dec(j);
    s:=s+s[j];
  end;
  write(s);
end.

program aaa;
 var i,j,m,n,k,l,t:longint;s:string;{a:array[0..10]of integer;
   w:string;{
   label 1; } q:char; f:boolean;
function aa(q:char):longint;
begin
 if pos(q,'aeiouAEIOU')>0 then aa:=1 else aa:=0;
end;
begin

{ assign(input,'input.txt');reset(input);
 assign(output,'output.txt');rewrite(output); }
 readln(n);  k:=n-3;  S:='ROYG';
 m:=k div 4;
 for i:=1 to m do write(S);

 for i:=1 to K mod 4 do write(s[i]);
 write('BIV');
end.

const
 s:array[0..6] of char = ('R','O','Y','G','B','I','V');
var
f:boolean;
 i,n,q,j:longint;
 ans:array[0..1000] of char;
begin
 readln(n);
 for i:=1 to n-3 do ans[i]:=s[i mod 4];
 q:=4;
 for i:=n-3 to n-1 do
 begin
  ans[i]:=s[q];
  inc(q);
 end;
 for i:=0 to 3 do
 begin
  f:=false;
  for j:=1 to 3 do if s[i]=ans[j] then
  begin
   f:=true;
   break;
  end;
  if not f then
  begin
   ans[n]:=s[i];
   for j:=1 to n do write(ans[j]);
   writeln;
  end;
 end;

end.

{$M 17777777}

//Uses Brain;

Uses
	Math , SysUtils;

Const
	inf = 1 shl 30;
type
	int = int64;

var a : Array[-100..201] of char;

procedure reading;
var n , i , j , k: longint; s : string;
begin
 readln(n);
 s:='ROYGBIV';
 j:=1;
 for i:=1 to n do begin
  a[i]:=s[j];
  inc(j);
  if j > 7 then
   j:=1;
 end;
 a[-1]:=a[n - 1];
 a[0]:=a[n];
 a[n + 1]:=a[1];
 a[n+2]:=a[2];
 a[n + 3]:=a[3];
 for i:= n mod 7 downto 1 do begin
 	for j:= 1 to 7 do begin
 		k:=n - i + 1;
 		if (s[j] <> a[k - 1]) and (s[j] <> a[k - 2]) and (s[j] <> a[k - 3])and
 		   (s[j] <> a[k + 1]) and (s[j] <> a[k + 2]) and (s[j] <> a[k + 3]) then
 		    begin
 		     a[k]:= s[j];
 		     break;
 		    end;
 	end;
 end;
 for i:=1 to n do write(a[i]);
end;

begin
  reading;
end.

var
 met:array [1..1000] of longint;
 i,j,n,m,k,l:longint;
 c:char;
 s,s1,ss:string;
begin
 readln(n);
 ss:='OYGBIV';
 l:=1;
 met[1]:=1;
 met[2]:=2;
 met[3]:=3;
 k:=4;
 l:=4;
 for i:=4 to n do
  begin
   met[i]:=l;
   inc(l);
   inc(k);
   if k>3 then
                begin
                 met[i]:=-1;
                 k:=0;
                 dec(l);
                end;
   if l>6 then l:=4;
  end;
  for i:=1 to n do
   if met[i]<>-1 then write(ss[met[i]])
    else write('R');
end.

var n,i:byte;
begin
    readln(n);
    for i:=1 to (n div 7) do
        write('ROYGBIV');
    case n mod 7 of
        0:writeln;
        1:writeln('G');
        2:writeln('GB');
        3:writeln('YGB');
        4:writeln('YGBI');
        5:writeln('OYGBI');
        6:writeln('OYGBIV');
    end;
    readln;
end.

var a,b,summ:array [0..100] of longint;
    n,m,k,i,j,v,l,r:longint;
    ans,ls:int64;
    s:ansistring;
    f:longint;

    function ii(x:longint):longint;
     begin
      x:=x+1;
      if x>n then x:=x-n;
      ii:=x;

     end;

begin
 {  assign(input,'input.txt');
   assign(output,'output.txt');
   reset(input);
   rewrite(output);  }
  readln(n);
  for i:=1 to 7 do
   a[i]:=i;

  for i:=8 to n do
   begin
    for j:=1 to 7 do
     if (a[i-1]<>j) and (a[i-2]<>j) and (a[i-3]<>j) and (a[ii(I)]<>j) and (a[ii(i+1)]<>j) and (a[ii(i+2)]<>j) then
      begin
        a[i]:=j;
        break;
      end;
   end;

 for i:=1 to n do
  begin
    if a[i]=1 then write('R') else
    if a[i]=2 then write('O') else
    if a[i]=3 then write('Y') else
    if a[i]=4 then write('G') else
    if a[i]=5 then write('B') else
    if a[i]=6 then write('I') else
    write('V');
  end;

end.

var n,i:byte;
begin
read(n);
for i:=1 to (n div 7)*7 do
case i mod 7 of
0:write('V');
1:write('R');
2:write('O');
3:write('Y');
4:write('G');
5:write('I');
6:write('B');
end;
case n mod 7 of
1:write('G');
2:write('GI');
3:write('GIB');
4:write('ROYG');
5:write('ROYGI');
6:write('ROYGIB');
end;
end.

var n,i:longint;
begin
  read(n);
  write('ROYGBIV');
  for i:=1 to n-7 do
    if i mod 4=1 then write('G')
    else if i mod 4=2 then write('B')
    else if i mod 4=3 then write('I')
    else write('V');
end.

var a:array[1..100] of integer;
c:array[1..100,1..7] of integer;
n,i,j,l:integer;

begin
readln(n);
for i:=1 to 7 do a[i]:=i;
for i:=n-2 to n do c[i,a[1]]:=1;
for i:=n-1 to n do c[i,a[2]]:=1;
c[n,a[3]]:=1;
for i:=5 to 7 do
  for j:=i+1 to i+3 do
    if j<=n then c[j,a[i]]:=1;
for i:=8 to n do
  begin
  l:=1;
  while (l<8) and(c[i,l]=1) do inc(l);
  a[i]:=l;
  for j:=i+1 to i+3 do
    if j<=n then c[j,a[i]]:=1;
  end;
for i:=1 to n do
  case a[i] of
  1:write('R');
  2:write('O');
  3:write('Y');
  4:write('G');
  5:write('B');
  6:write('I');
  7:write('V')
  end;
writeln;
end.

Const col='ROYGBIV';{ fp }
Var
 n,j,color : longint;
 a : array[0..104] of longint;
 rt,used : array[0..10] of longint;
 ok : boolean;

 Function good(x1,x2,x3,x4:longint):boolean;
  Begin
   If (x1=x2) or (x1=x3) or (x1=x4) or (x2=x3) or (x2=x4) or (x3=x4) then good := false
    else good := true;
  End;

 Procedure go(num:longint);
  Var
   i:longint;

  begin
   If num=n+1 then
    begin
     ok := true;
     a[n+1] := a[1];
     a[n+2] := a[2];
     a[n+3] := a[3];
     a[n+4] := a[4];
     For i := n-2 to n do
      If not good(a[i],a[i+1],a[i+2],a[i+3]) then
       Begin
        ok := false;
        break;
       End;
    If (ok=false) or (color<>7)then exit;
     For i := 1 to n do
      Write(col[a[i]]);
     WriteLn;
     halt(0);
    end;
  If num>4 then  used[a[num-4]] := 0;
   For i := 1 to 7 do
    If used[i]=0 then
     Begin
      rt[i] := rt[i]+1;
      If rt[i]=1 then color := color+1;
      used[i] := 1;
      a[num] := i;
      go(num+1);
      used[i] := 0;
      rt[i] := rt[i]-1;
      If rt[i]=0 then color := color-1;
     End;
    if num>4 then  used[a[num-4]] := 1;
  end;

 Begin
  REad(n);
  color := 0;
  go(1);
 end.

uses
  SysUtils;
  const Mas:array[1..7] of char=('R','O','Y','G','B','I','V');
VAR N,i,j:INTEGER;   m:set of char;   len:string;
begin
readln(n);  len:='';
for i:=1 to n-n mod 7 do begin
if i mod 7=0 then begin write(mas[7]);len:=len+mas[7]; end else begin write(mas[i mod 7]);len:=len+mas[i mod 7];end;
end;
m:=[];
for i:=n+1-n mod 7  to n do begin
   m:=[];
   for j:=i-3 to i-1 do m:=m +[len[j]];
   for j:=i+1 to i+3 do if j>n then m:=m + [len[j mod (n+1) +1]];
   for j:=1 to 7 do if not (mas[j] in m) then begin write(mas[j]);len:=len+mas[j];break;end;
   end;
end.

var n:longint;
    i,count:longint;
    s:String;
begin
 readln(n);
 s:='ROYGBIV';
 for i:= 1 to n div 7 * 7 do
 write(s[(i-1) mod 7 + 1]);
 count:=n-n div 7 * 7;
 case count of
 1:writeln('G');
 2:writeln('GB');
 3:writeln('GBI');
 4:writeln('GBIV');
 5:writeln('ROYGB');
 6:writeln('ROYGBI');
 0:writeln;
 end;
end.

Var
   n,i:Word;
   s:String;
Begin
   Read(n);
   s:='ROYGBIV';
   For i:=1 To n div 7 Do Write(s);
   If n mod 7=1 Then Write('G');
   If n mod 7=2 Then Write('GB');
   If n mod 7=3 Then Write('GBI');
   If n mod 7=4 Then Write('GBIV');
   If n mod 7=5 Then Write('YGBIV');
   If n mod 7=6 Then Write('OYGBIV');

End.

uses math;

const kt:array[0..6]of char=('R','Y','O','I','B','G','V');
var i,n:longint;
       s:string;
begin
  readln(n);
            s:='';
  for i:=0 to 7 * (n div 7)-1 do
     begin
      s:=s+kt[i mod 7];
     end;

    case n mod 7 of
    1:s:=s+kt[3];
    2: begin
       s:=s+kt[3]+kt[4];
    end;
    3: begin
       s:=s+kt[3]+kt[4] +kt[5];
    end;
    4: begin
       s:=s+kt[3]+kt[4]+kt[5]+kt[6];
    end;
    5: begin
       s:=s+kt[3]+kt[2]+kt[4]+kt[5]+kt[6];
    end;
    6:begin
    s:=s+kt[3]+kt[2]+kt[1]+kt[4]+kt[5]+kt[6];
      end;
    end;
    writeln(s);
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

procedure _halt(s:string);
begin
writeln(s);
halt;
//{$IFDEF ONLINE_JUDGE}
end;

function cnt(s:string):integer;
var i,ans:integer;
begin
ans:=0;
for I := 1 to length(s) do
if s[i] in ['a','o','u','e','i'] then inc(ans);

cnt:=ans;
end;

var s:string;
i,n:integer;
begin
readln(n);
n:=n-7;
s:='ROYGBIV';
for I := 1 to n do
  case i mod 4 of
  0:s:=s+'V';
  1:s:=s+'G';
  2:s:=s+'B';
  3:s:=s+'I';
  end;
writeln(s);
end.

var n,c,i:integer;

begin
readln(n);
c:=n div 7;
for i:=1 to c do
write('ROYGBIV');
n:=n mod 7;
if n=1 then write('G');
if n=2 then write('GB');
if n=3 then write('YGB');
if n=4 then write('YGBI');
if n=5 then write('OYGBI');
if n=6 then write('OYGBIV');
end.

const a:array[0..6]of char = ('R','O','Y','G','B','I','V');
var
n,i:longint;
 begin
  readln(n);
  for i:=1 to n-3 do
    write(a[(i-1)mod 4]);
  writeln('BIV');
 end.

{$MODE OBJFPC}
Program onlylove;
uses math;
const color : array[0..6] of char = ('R','O','Y','G','B','I','V');
var n : integer;
   i  : integer;

begin
   Readln(n);
   if (n mod 7 >= 4) or (n mod 7 = 0) then
       for i:=1 to n do Write(color[i mod 7])
   else
     begin
       for i:= 1 to n - n mod 7 do Write(color[i mod 7]);
       for i:= 1 to n mod 7 do Write(color[ (i +3) mod 7]);
     end;

end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var n,i:Longint;
    a:array[1..100]of Char;

begin
  //Reset(Input,'in.txt');
  //Rewrite(Output,'out.txt');
  a[1]:='R';
  a[2]:='O';
  a[3]:='Y';
  a[4]:='G';
  Read(n);
  if n=7 then Write('ROYGBIV') else begin
    for i:=5 to n-3 do a[i]:=a[i-4];
    for i:=1 to n-3 do
      Write(a[i]) ;
    Write('BIV');
  end;
end.

var  mas : array [1..100] of string ;
     colors : array [1..7] of string ;
     n : longint ;

function p(x:longint):longint ;
 Begin
  if x<=n then p:=x else p:=x-n ;
 End;

procedure argh(k:longint) ;
var i,j,l : longint ;
Begin
 if k=n+1 then
  begin
   l:=0 ;
   for i:=1 to n do
    begin
     if (mas[p(i)]<>mas[p(i+1)]) and (mas[p(i)]<>mas[p(i+2)]) and (mas[p(i)]<>mas[p(i+3)])
     and (mas[p(i+1)]<>mas[p(i+2)]) and (mas[p(i+1)]<>mas[p(i+3)]) and (mas[p(i+2)]<>mas[p(i+3)]) then inc(l) ;

     if l=n then
      begin
       for j:=1 to n do write(mas[j]) ;
       halt ;
      end
    end;
  end;
 for i:=1 to n do
  if mas[i]='' then
   begin
    if k mod 7 = 0 then mas[i]:=colors[7] else mas[i]:=colors[k mod 7] ;
    argh(k+1) ;
    mas[i]:='' ;
   end;
End;

Begin
 readln(n) ;
 colors[1]:='R' ; colors[2]:='O' ; colors[3]:='Y' ; colors[4]:='G' ;
 colors[5]:='B' ; colors[6]:='I' ; colors[7]:='V' ;
 argh(1) ;
End.

const t:array[1..7] of char=('R','O','Y','G','V','B','I');
var i,c,n:longint;
begin
{$IFNDEF ONLINE_JUDGE}
reset(input,'input.txt');
rewrite(output,'output.txt');
{$ENDIF}
read(n);
for i:=1 to 7 do
    write(t[i]);
c:=4;
for i:=8 to n do begin
    write(t[c]);
    inc(c);
    if c=8 then c:=4;
end;
end.

const
a:array[0..6] of char=('R','O','Y','G','B','I','V');
var
n,i,j,l:longint;
b:array[1..10000] of char;
begin
 readln(n);
 for i:=1 to 7 do
        b[i]:=a[i mod 7];
for j:=1 to n-10 do
         for l:=0 to 6 do
                if (a[l]<>b[i])
                and(a[l]<>b[i-1])
                and(a[l]<>b[i-2])
                and(i<n)
                then
                        begin
                        inc(i);
                        b[i]:=a[l];
                        break;
                        end;
for j:=1 to 3 do
 for l:=0 to 6 do
                if (a[l]<>b[i])
                and(a[l]<>b[i-1])
                and(a[l]<>b[i-2])
                and(a[l]<>b[1])
                and(a[l]<>b[2])
                and(a[l]<>b[3])
                and(i<n)
                then
                        begin
                        inc(i);
                        b[i]:=a[l];
                        break;
                        end;

for i:=1 to n do
write(b[i]);
end.

var
  l: string;
  n: shortint;

begin
  readln(n);
  l := 'ROYGBIV';
  write(l * (n div 7));
  n := n mod 7;
  if n = 1 then
    write('G')
  else
  if n = 2 then
    write('GB')
  else
  if n = 3 then
    write('GBI')
  else
  if n = 4 then
    write('GBIV')
  else
  if n = 5 then
    write('GBIVG')
  else
  if n = 6 then
    write('GBIVGB');
end.

var
 s:string;
 x:integer;
 begin
read(x);
 s:='ROYGBIV';
 while length(s)<x do
 s:=s+copy(s,length(s)-3,4);
 write(copy(s,1,x));
end.

Program 		B_B;
var
n,i,j : longint;
k : array[0..200] of Longint;
a : array[1..7] of char;
function		checker(p,l : longint) : Boolean;
var i,now : longint;
begin
	for i :=p-3 to p-1 do
	begin
		if i<=0 then continue;

		if k[i]=l then exit(false);
	end;
	for i := p+1 to p+3 do
	begin
		if i<=n then continue;

		now := i-n;
		if k[now]=l then exit(false);
	end;
	exit(true);
end;
begin
{Assign(input,'B.in');Assign(output,'B.out');
reset(input); rewrite(output);}
	readln(n);
	a[1]:='R';a[2]:='O';a[3]:='Y';
	a[4]:='G';a[5]:='B';a[6]:='I';
	a[7]:='V';
        for i :=1 to 7 do k[i]:=i;
	for i :=8 to n do
	begin

		for j :=1 to 7 do
		if checker(i,j) then
		begin
			k[i]:= j;break;
		end;
	end;
	for i :=1 to n do
	write(a[k[i]]);
{Close(input); Close(output);}
end.

var
  s : string;
  n, i : longint;
begin
  readln(n);
  s := 'ROYGBIV';
  for i := 8 to n do
  begin
    s := s + ' ';
    s[i] := s[i - 4];
  end;
  writeln(s);
end.

const
	a:array[0..3] of char=('R','O','Y','G');
var
	n,i:longint;
begin
	readln(n);
	for i:=1 to n-3 do
		write(a[i mod 4]);
	writeln('BIV');
end.

const a:array[1..7] of char=('R','O','Y','G','B','I','V');
      b:array[1..4] of char=('G','B','I','V');
var n:integer;
    m:array[1..200] of char;

procedure form;
var i:integer;may:set of char;
begin
 for i:=1 to n do
  if i<=3 then write(a[i])
  else write(b[i mod 4+1]);
end;

BEGIN
 readln(n);
 form;
END.

var
 i,n:longint;
begin
 readln(n);
 write('ROY');
 for i:=4 to n do
 begin
  if (i mod 4=1) then write('B') else
  if (i mod 4=2) then write('I') else
  if (i mod 4=3) then write('V') else
  if (i mod 4=0) then write('G') else
 end;
end.

program Pasha;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var s:string; n,i:integer;
begin
read(n);
repeat
 s:=s+'GBIV';
until length(s)>=n;
if length(s)>n then delete(s,n+1,length(s)-n);
s[n]:='R';s[n-1]:='O'; s[n-2]:='Y';
writeln(s);
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const strs:array [0..6] of string=('','G','GB','YGB','YGBI','OYGBI','OYGBIV');

var n,i:integer;

begin
readln(n);
for i:=1 to n div 7 do
        write('ROYGBIV');
write(strs[n mod 7]);
  { TODO -oUser -cConsole Main : Insert code here }
end.

program Project4;
{$APPTYPE CONSOLE}

uses sysutils,math;

const
  str = 'ROYGBIV';

var n,x,k,t1,t2,y,b: integer;
    i,j: longint;
    a: array [1..1000] of real;
    s: string;
begin
  readln(n);
  s := str;
  for i := 8 to n do
    s := s + s[i-4];
  write(s);
end.

Const
  AA:Array[1..7]Of Char=('R','O','Y','G','B','I','V');

Var
  N:Integer;
  A:Array[1..7]Of Integer;
  B:Array[0..100]Of Integer;

  Procedure Rec(X,L1,L2,L3,R1,R2,R3:Integer);
  Var I,J:Integer;
  Begin
    If X=N
    Then Begin
      For I:=1 To N Do
        If A[I]=0
        Then Exit;

      For I:=0 To N-1 Do
        For J:=I+1 To (I+3)Mod N Do
          If B[I]=B[J]
          Then Exit;

      For I:=0 To N-1 Do
        Write(AA[B[I]]);

      Halt(0);
    End;

    For I:=1 To 7 Do
      If (I<>L1)And(I<>L2)And(I<>L3)And(I<>R1)And(I<>R2)And(I<>R3)
      Then begin
        Inc(A[i]);B[X]:=I;
        Rec(X+1,L2,L3,I,B[(X+2)Mod N],B[(X+3)Mod N],B[(X+4)Mod N]);
        Dec(A[I]);
      End;
  End;

Begin
  {Assign(Input,'Input.txt');Reset(Input);
  Assign(Output,'Output.txt');Rewrite(Output);}

  Readln(N);
  FillChar(A,SizeOf(A),0);
  FillChar(B,SizeOf(B),0);
  Rec(0,0,0,0,0,0,0);
End.

program n21;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var q,w,e,r,n,t: longint;
           a,s,d: string;
begin
 read(n);
 write('OYGRBIV');
 if n>7 then
 begin
 n:=n-7;
 q:=0;
  repeat

  if (q mod 4=0) then write('R');
  if (q mod 4=1) then write('B');
  if (q mod 4=2) then write('I');
  if (q mod 4=3) then write('V');
   q:=q+1 ;
  until q=n;

 end;

  { TODO -oUser -cConsole Main : Insert code here }
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var n,i,k:integer;
    a,b:array[1..10000] of char;
    s:string;
    f:boolean;
begin
a[1]:='R';
a[2]:='O';
a[3]:='Y';
a[4]:='G';
a[5]:='B';
a[6]:='I';
a[7]:='V';
readln(n);
for i:=1 to 7 do
b[i]:=a[i];
for i:=1 to n-7 do
b[i+7]:=b[i+7-4];
for i:=1 to n do
write(b[i]);
//readln;
end.

{$apptype console}
const c: string = 'ROYGBIV';
      maxn = 110;

var sol: array [1..maxn] of char;
    n,i : integer;
begin
  read( n );
  for i := 1 to n do sol[i] := c[(i-1) mod 4 + 1];
  for i := 1 to 3 do sol[n-i+1] := c[i+4];
  for i := 1 to n do write( sol[i] );
end.

const t:array[1..7] of char=('R','O','Y','G','V','B','I');
var i,c,n:longint;
begin
read(n);
for i:=1 to 7 do
    write(t[i]);
c:=4;
for i:=8 to n do begin
    write(t[c]);
    inc(c);
    if c=8 then c:=4;
end;
end.

{$R+ Q+ I+}
{$APPTYPE CONSOLE}
uses
  SysUtils;
var
   n,i : integer;
   c : array [1..8] of char;

begin
     read(n);
     c[1] := 'G';
     c[2] := 'B';
     c[3] := 'I';
     c[4] := 'V';
     c[5] := 'G';
     c[6] := 'B';
     c[7] := 'I';
     for i := 1 to n div 7 do write('ROYGBIV');
     for i := 1 to n mod 7 do write(c[i]);
end.

{$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O-,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  next, pred : array[0..100] of integer;
  a : array[0..100] of char;
  s : array[1..7] of char = ('R', 'O', 'Y', 'G', 'B', 'I', 'V');
  i, j, t, x, n : integer;
  l : boolean;

begin
  //reset(input, 'input.txt');
  //rewrite(output, 'output.txt');

  read(n);
  for i := 1 to n do begin
    a[i] := 'a';
    next[i] := i + 1;
    pred[i] := i - 1;
  end;
  next[n] := 1;
  pred[1] := n;
  for i := 1 to 7 do
    a[i] := s[i];
  for i := 8 to n do
    for j := 1 to 7 do begin
      a[i] := s[j];
      l := true;
      x := i;
      for t := 1 to 3 do
        if a[pred[x]] = a[i] then
          l := false
        else
          x := pred[x];
      x := i;
      for t := 1 to 3 do
        if a[next[x]] = a[i] then
          l := false
        else
          x := next[x];
      if l then
        break;
    end;

  for i := 1 to n do
    write(a[i]);

  //close(input);
  //close(output);
end.

{$apptype console}
{$R+,S+,I+,Q+}
const
     inf = 'input.txt';
     outf = 'output.txt';
     clr:array[1..7] of char = ('R','O','Y','G','B','I','V');
var
 n,i:longint;
 ans:array[1..1000] of char;
begin
 //reset(input,inf);
 //rewrite(output,outf);
 read(n);
 for i:=1 to 7 do ans[i]:=clr[i];
 for i:=8 to n do ans[i]:=ans[i-4];
 for i:=1 to n do write(ans[i]);
end.

var
  s:string;
  x:integer;
begin
//  Reset(input,'input.txt'); Rewrite(output,'output.txt');
  read(x);
  s:='ROYGBIV';
  while length(s)<x do
  s:=s+copy(s,length(s)-3,4);
  write(copy(s,1,x));
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  c:array[0..6] of Char;
  n,i:LongInt;
  a:array[1..110] of LongInt;

function get(h:LongInt):LongInt;
var
  inf:array[-1..6] of Boolean;
  i,res:LongInt;
begin
  for i:=0 to 6 do
    inf[i]:=False;
  for i:=h-3 to h+3 do
  begin
    inf[a[i]]:=True;
  end;
  for i:=0 to 6 do
  begin
    if not(inf[i]) then res:=i;
  end;
  get:=res;
end;

begin
  fillchar(a,sizeOf(a),-1);
  c[0]:='R';
  c[1]:='O';
  c[2]:='Y';
  c[3]:='G';
  c[4]:='B';
  c[5]:='I';
  c[6]:='V';

  Readln(n);
  a[n+1]:=0;
  a[n+2]:=1;
  a[n+3]:=2;
  For i:=0 to n-5 do
  begin
    write(c[i mod 7]);
    A[i+1]:=i mod 7;
  end;
  for i:=n-3 to n do
  begin
    A[i]:=get(i);
    write(c[a[i]]);
  end;
  readln;

  { TODO -oUser -cConsole Main : Insert code here }
end.

{$APPTYPE CONSOLE}
var
 j,i,n:integer;
 s:array[1..101] of char;
 C:Char;

begin
{reset(input,'Input.txt');
rewrite(output,'Output.txt');}
readln(n);
If n=8 then write('ROYGRBIV') ELSE
If N=9 then write('ROYGRBIVG') else
If n=10 then write('ROYGRBIVGB') else
begin
For i:=1 to n-3 do
 If i mod 7=1 then s[i]:='R' else
 If i mod 7=2 then s[i]:='O' else
 If i mod 7=3 then s[i]:='Y' else
 If i mod 7=4 then s[i]:='G' else
 If i mod 7=5 then s[i]:='B' else
 If i mod 7=6 then s[i]:='I' else
 If i mod 7=0 then s[i]:='V';

 For j:=1 to 7 do
 begin
  i:=n-2;
  If j mod 7=0 then c:='R' else
  If j mod 7=1 then c:='O' else
  If j mod 7=2 then c:='Y' else
  If j mod 7=3 then c:='G' else
  If j mod 7=4 then c:='B' else
  If j mod 7=5 then c:='I' else
  If j mod 7=6 then c:='V';
  If (s[1]<>c) and (s[i-1]<>c) and (s[i-2]<>c) and (s[i-3]<>c) then
  begin
   s[i]:=c;
   break;
  end;
 end;

 For j:=1 to 7 do
 begin
  i:=n-1;
  If j mod 7=0 then c:='R' else
  If j mod 7=1 then c:='O' else
  If j mod 7=2 then c:='Y' else
  If j mod 7=3 then c:='G' else
  If j mod 7=4 then c:='B' else
  If j mod 7=5 then c:='I' else
  If j mod 7=6 then c:='V';
  If (s[1]<>c) and (s[i-1]<>c) and (s[i-2]<>c) and (s[i-3]<>c) and (s[2]<>c) then
  begin
   s[i]:=c;
   break;
  end;
 end;

 For j:=1 to 7 do
 begin
  i:=n;
  If j mod 7=0 then c:='R' else
  If j mod 7=1 then c:='O' else
  If j mod 7=2 then c:='Y' else
  If j mod 7=3 then c:='G' else
  If j mod 7=4 then c:='B' else
  If j mod 7=5 then c:='I' else
  If j mod 7=6 then c:='V';
  If (s[1]<>c) and (s[i-1]<>c) and (s[i-2]<>c) and (s[i-3]<>c) and (s[3]<>c) and (s[2]<>c) then
  begin
   s[i]:=c;
   break;
  end;
 end;

 For i:=1 to n do write(s[i]);
end;
end.

var n, i: byte;
begin
        readln(n);
        dec(n, 7);
        write('ROYGBIV');
        for i := 1 to n div 4 do
                write('ROYG');
        case n mod 4 of
                1: write('G');
                2: write('GB');
                3: write('GBI');
        end;
end.

program Project1112;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const
 a:array[1..7] of char = ('R','O','Y','G','B','I','V');
var
 i,j,k,n:integer;
 s:string;
begin
  { TODO -oUser -cConsole Main : Insert code here }
  readln(n);
   if n<=7 then
    for i:=1 to n do
     begin
      s:=s+a[i];
      exit;
     end;
  s:='ROYGBIV';
   while length(s)<n do
    begin
     j:=length(s)-3;
      s:=s+s[j];
    end;
  writeln(s);
end.

Var
n,i:longint;
s:string;
Begin
read(n);
s:='ROYGBIV';
for i:=1 to (n div 7)-1 do
 write(s);write('ROYG');
for i:=1 to (n mod 7) do
 write(s[i]);
if (n mod 7)<=4 then write('BIV') else
 Begin
 for i:=(n mod 7)-3 to (n mod 7)-1 do
 write(s[i]);
 end;
end.

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  n:integer;
  i:integer;
  kol:integer=1;
begin
  readln(n);
  for i:=1 to n-4 do
  begin
    if kol = 8 then
      kol := 1;
    case kol of
      1:  write('R');
      2:  write('O');
      3:  write('Y');
      4:  write('G');
      5:  write('B');
      6:  write('I');
      7:  write('V');
    end;
    inc(kol);
  end;

  kol := 1;
  for i:=n-4 to n do
  begin
    case kol of
      1:  write('R');
      2:  write('O');
      3:  write('Y');
      4:  write('G');
    end;
    inc(kol);
  end;
end.

var n,i:longint;
 begin
  read(n);
  for i:=1 to n do
   begin
    if i=1 then write('R')
    else
    if i=2 then write('O')
    else
    if i=3 then write('Y')
    else
    if i=4 then write('G')
    else
    if i=5 then write('B')
    else
    if i=6 then write('I')
    else
    if i=7 then write('V')
    else
    if i mod 2=0 then write('R')
    else write('O');
   end;
 end.

program shablon;
{$O+ R-  Q-} {$ASSERTIONS ON} {$INLINE ON}
{$H+}
{$EXTENDEDSYNTAX ON SMARTLINK ON} { MEMORY SS, HS }
{$COperators ON} {$MACRO ON}
{$MODE OBJFPC}
{$DEFINE uu := for}

uses
 SysUtils,Math;

const inf=1/0;
      s='ROYGBIV';

type tpoint=record
      x,y:extended;
     end;

     tnode=record
      x,y,l,r,a,c:longint;
     end;

var x,y:extended;
    n:longint;
    ans:string;

{$IFNDEF ONLINE_JUDGE}
operator **(x,y:extended):extended;
begin
  result:=exp(ln(X)*Y);
end;
{$ENDIF}

procedure pout inline;
begin
 writeln(ans);
{$IFNDEF ONLINE_JUDGE}
 close(input);
 close(output);
{$ENDIF}
 halt(0);
end;

procedure pinit inline;
begin
{$IFNDEF ONLINE_JUDGE}
 assign(input,'input.txt');
 assign(output,'output.txt');
 reset(input);
 rewrite(output);
{$ENDIF}
 readln(n);
end;

procedure solve;
var i:longint;
begin
 ans:='';
 for i:=1 to (n div 4)*4 do
  begin
   ans+=s[(i-1) mod 4 +1];
  end;
 for i:=1 to n mod 4 do
  begin
   ans+=s[4+i];
  end;
end;

begin
 pinit;
 solve;
 pout;
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;
          var n,i,j,k:integer; s:string; eggs:array [1..100] of string; colours:array [1..7] of string;
begin
  { TODO -oUser -cConsole Main : Insert code here }

  colours[1]:='R';
  colours[2]:='O';
  colours[3]:='Y';
  colours[4]:='G';
  colours[5]:='B';
  colours[6]:='I';
  colours[7]:='V';
  readln (n);
  for i:=1 to n do begin
    if j=8 then j:=1;
    eggs[i]:=colours[j];
    inc(j);
  end;
  for i:=1 to n do
    write (eggs[i]);
  close (input);
  close (output);
end.

{$R+ Q+ I+}
{$APPTYPE CONSOLE}
uses
  SysUtils;
var
   n,i : integer;
   c : array [1..8] of char;

begin
     read(n);
     c[1] := 'R';
     c[2] := 'O';
     c[3] := 'Y';
     c[4] := 'G';
     c[5] := 'B';
     c[6] := 'I';
     c[7] := 'V';
     for i := 1 to n div 7 do write('ROYGRBIV');
     for i := 1 to n mod 8 do write(c[i]);
end.

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  n:integer;
  i:integer;
  kol:integer=1;
begin
  readln(n);
  for i:=1 to n do
  begin
    if kol = 8 then
      kol := 1;
    case kol of
      1:  writeln('R');
      2:  writeln('O');
      3:  writeln('Y');
      4:  writeln('G');
      5:  writeln('B');
      6:  writeln('I');
      7:  writeln('V');
    end;
    inc(kol);
  end;

end.

const
a:array[0..6] of char=('R','O','Y','G','B','I','V');
var
n,i,j,l:longint;
begin
 readln(n);
 for i:=1 to (n div 7)*7 do
        write(a[i mod 7]);
l:=(n mod 7)+1;
if l=7 then
l:=2;
i:=i mod 7;
if n=8 then
begin
write('B');
halt;
end
else
if n=9 then
begin
write('IG');
halt;
end;
for j:=1 to n mod 7 do
        begin
        write(a[(i+l)mod 7]);
        inc(i);
        end;

end.

var  i,k:integer;
begin
readln(k);
if k mod 7 =0 then write('ROYGBIV');
if k mod 8 =0 then write('ROYGRBIV');
if k mod 13 =0 then write('ROYGBIVGBIVYG');
if (k mod 2 =0) and(k mod 8<>0) then write('ROYGROYG');
if (k mod 5 =0)  then write('ROYGIROYGI');
if (k mod 3 =0)  then write('ROYGIVROYGIV');
end.

program d;
var
     a,b : array [1..111] of char;
       c : char;
i,j,n,i1 : integer;
       f : boolean;
BEGIN
b[1]:='R';
b[2]:='O';
b[3]:='Y';
b[4]:='G';
b[5]:='B';
b[6]:='I';
b[7]:='V';
readln (n);

for i:=1 to 7 do a[i]:=b[i];
for I:=8 to n do
   for i1:=1 to 7 do
        begin
	f:=false;
        for j:=1 to 3 do
               begin
               if i+j>n then c:=a[(i+j) mod n] else c:=a[i+j];
	       if (a[i-j]=b[i1]) or (c=b[i1]) then f:=true;
  	       end;
        if not f then a[i]:=b[i1];
	end;
for i:=1 to n-1 do write (a[i],' ');  write (a[n]);

END.

program b70;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var n,i,j:integer;
    col:array[0..6] of char = ('R','O','Y','G','B','I','V');
begin
  {$IFNDEF ONLINE_JUDGE}
  reset(input,'input.txt');
  rewrite(output,'output.txt');
  {$ENDIF}
  readln(n);
  for i:=1 to n do write(col[i mod 7]);
end.

var
   n,i:longint;
begin
     read(n);
     for i:=1 to n do begin
         if i mod 7=0 then write('R');
         if i mod 7=1 then write('O');
         if i mod 7=2 then write('Y');
         if i mod 7=3 then write('G');
         if i mod 7=4 then write('B');
         if i mod 7=5 then write('I');
         if i mod 7=6 then write('V');
     end;
end.

program z;
 const
  ar:array[1..7] of char=('R','G','B','O','Y','I','V');
 var
  a:array[1..103] of char;
  n,i,j:integer;
 begin
  read(n);
  a[1]:='R';
  a[2]:='G';
  a[3]:='B';
  a[n+1]:='R';
  a[n+2]:='G';
  a[n+3]:='B';
  for i:=4 to n-3 do
   begin
    for j:=1 to 7 do
     begin
      if (a[i-1]<>ar[j])and(a[i-2]<>ar[j])and(a[i-3]<>ar[j])
       then
        begin
         a[i]:=ar[j];
         break;
        end;
     end;
   end;
  for i:=n-3 to n do
   begin
    for j:=1 to 7 do
     begin
      if (a[i-1]<>ar[j])and(a[i-2]<>ar[j])and(a[i-3]<>ar[j])and
         (a[i+1]<>ar[j])and(a[i+2]<>ar[j])and(a[i+3]<>ar[j])
       then
        begin
         a[i]:=ar[j];
         break;
        end;
     end;
   end;
  for i:=1 to n do write(a[i]);
end.

var  i,k:integer;
begin
readln(k);
if k mod 7 =0 then write('ROYGBIV');
if k mod 8 =0 then write('ROYGRBIV');
if k mod 13 =0 then write('ROYGBIVGBIVYG');
if (k mod 4 =0) and(k mod 8<>0) then write('ROYGROYG');
if (k mod 5 =0)  then write('ROYGIROYGI');
if (k mod 6 =0)  then write('ROYGIVROYGIV');
end.

const color:array[1..7] of char=('O','Y','G','B','I','V','R');
var answ:array[1..100] of char;
    n:longint;

 procedure InputData;
 begin
 readln(n);
 end;

 procedure ins(x:longint);
 var j:longint;
 begin
 j:=1;
 while (color[j]=answ[x-1]) or (color[j]=answ[x-2]) or (color[j]=answ[x-3]) do
        inc(j);
 answ[x]:=color[j];
 end;

 procedure ProcessData;
 var i,j:longint;
 begin
 for i:=1 to 7 do
        answ[i]:=color[i];
 for i:=8 to n-1 do
        begin
        ins(i);
        end;
 j:=1;
 while (color[j]=answ[n-1]) or (color[j]=answ[1]) or (color[j]=answ[n-2]) or (color[j]=answ[n-3]) do
        inc(j);
 answ[n]:=color[j];
 end;

 procedure OutputData;
 var i:longint;
 begin
 for i:=1 to n do
        write(answ[i]);
 end;
begin
Inputdata;
ProcessData;
OutputData;
end.

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  n:integer;
  i:integer;
  s:string='ROYGBIV';
begin
  readln(n);

  for i:=1 to 7*(n div 7) do
  begin
    if s<>'' then
    begin
      write(s[1]);
      delete(s,1,1);
    end
      else
        begin
          write('R');
          s := 'OYGBIV';
        end;
  end;

  s := 'ROYGBIV';

  for i:=7*(n div 7) to n do
    write(s[i-3]);
end.

program z;
 const
  ar:array[1..7] of char=('R','G','B','O','Y','I','V');
 var
  a:array[1..103] of char;
  n,i,j:integer;
 begin
  read(n);
  for i:=1 to 103 do a[i]:='.';
  a[1]:='R';
  a[2]:='G';
  a[3]:='B';
  a[4]:='O';
  a[5]:='Y';
  a[6]:='I';
  a[7]:='U';
  a[n+1]:='R';
  a[n+2]:='G';
  a[n+3]:='B';
  for i:=8 to n-3 do
   begin
    for j:=1 to 7 do
     begin
      if (a[i-1]<>ar[j])and(a[i-2]<>ar[j])and(a[i-3]<>ar[j])
       then
        begin
         a[i]:=ar[j];
         break;
        end;
     end;
   end;
  for i:=n-3 to n do
   begin
    for j:=1 to 7 do
     begin
      if (a[i-1]<>ar[j])and(a[i-2]<>ar[j])and(a[i-3]<>ar[j])and
         (a[i+1]<>ar[j])and(a[i+2]<>ar[j])and(a[i+3]<>ar[j])and(a[i]='.')
       then
        begin
         a[i]:=ar[j];
         break;
        end;
     end;
   end;
  for i:=1 to n do write(a[i]);
end.

var i,j,n,m,k:longint;
a:string;
begin
a:='ROYGBIV';
readln (n);
j:=0;
k:=0;
for i:=1 to (n div 7)*7+1 do
  begin
    inc (j);
    if j<=7 then write (a[j])
    else j:=j-8;
  end;
if n mod 7 = 0 then writeln ;
if n mod 7 = 1 then writeln ('G');
if n mod 7 = 2 then writeln ('GB');
if n mod 7 = 3 then writeln ('GBI');
if n mod 7 = 4 then writeln ('GBIV');
if n mod 7 = 5 then writeln ('GBIVG');
if n mod 7 = 6 then writeln ('GBIVGB');
end.

const
 s:array[0..6] of char = ('R','O','Y','G','B','I','V');
var
 i,n:longint;
 ans:array[0..1000] of char;
begin
 readln(n);
   for i:=1 to n do ans[i]:=s[i mod 7];
   if ans[n]=ans[1] then ans[n]:=ans[n-4];
   for i:=1 to n do write(ans[i]);
 writeln;
end.

var n,i:longint;
 begin
  read(n);
  for i:=1 to n do
   begin
    if i=1 then write('R')
    else
    if i=2 then write('O')
    else
    if i=3 then write('Y')
    else
    if i=4 then write('G')
    else
    if i=5 then write('B')
    else
    if i=6 then write('I')
    else
    if i=7 then write('V')
    else
    if i mod 4=1 then write('R')
    else
    if i mod 4=2 then write('O')
    else
    if i mod 4=3 then write('Y')
    else write('G');
   end;
 end.

const c:set of char = ['a','e','u','i','o'];
var i,j,ans,n,m,k:longint;
    a:array [1..10000] of longint;
    s:ansistring;
begin
 readln(n);
 k:=1;
 for i:=1 to n do
  begin
  if (i=n-1) then
   begin
    write('Y');
    continue;
   end;
  if (i=n) then
   begin
    write('G');
    continue;
   end;
     if (i=n-2) then
   begin
    write('O');
    continue;
   end;

     if (i=n-3) then
   begin
    write('R');
    continue;
   end;
   if k=1 then write('R');
   if k=2 then write('O');
   if k=3 then write('Y');
   if k=4 then write('G');
    if k=5 then write('B');
     if k=6 then write('I');
      if k=7 then write('V');

      inc(k);
      if k=8 then k:=1;
  end;
end.

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  n:integer;
  i:integer;
  s:string='ROYGBIV';
begin
  readln(n);
  for i:=1 to n-3 do
  begin
    if s<>'' then
    begin
      write(s[1]);
      delete(s,1,1);
    end
      else
        begin
          write('G');
          s :='ROYGBIV';
        end;
  end;

  write('YGB');
end.

var
n,i:longint;
begin
        readln (n);
        for i:=1 to n do
        if i mod 7=1 then
                write ('R')
        else
        begin
                if i mod 7=2 then
                        write ('O')
                else
                begin
                        if i mod 7=3 then
                                write ('Y')
                        else
                        begin
                                if i mod 7=4 then
                                        write ('G')
                                else
                                begin
                                        if i mod 7=5 then
                                                write ('B')
                                        else
                                        begin
                                                if i mod 7=6 then
                                                        write ('I')
                                                else
                                                        write ('V');
                                        end;
                                end;
                        end;
                end;
        end;
end.

uses
  SysUtils;
  const Mas:array[1..7] of char=('R','O','Y','G','B','I','V');
VAR N,i,j:INTEGER;   m:set of char;   len:string;
begin
readln(n);
for i:=1 to n-n mod 7 do begin
write(mas[i]);len:=len+mas[i];  end;
m:=[];
for i:=n+1-n mod 7  to n do begin
   m:=[];
   for j:=i-3 to i-1 do m:=m +[len[j]];
   for j:=i+1 to i+3 do if j>n then m:=m + [len[j mod (n+1)+1]];
   for j:=1 to 7 do if not (mas[j] in m) then begin write(mas[j]);len:=len+mas[j];break;end;
end;
end.

program codeforces;

{$APPTYPE CONSOLE}
{$R+ Q+ I+}

uses
  SysUtils;

var
  n,i,j: integer;
  a: array[1..7]of char;
  t: char;
begin
  read(n);
  a[1]:='R';
  a[2]:='O';
  a[3]:='Y';
  a[4]:='G';
  a[5]:='B';
  a[6]:='I';
  a[7]:='V';
  j:=1;
  if (n-1) mod 7=0 then n:=n-1;
  for i:=1 to n do begin
    if j=8 then j:=1;
    write(a[j]);
    if i=n then t:=a[j];
    inc(j);
  end;
  if n mod 7=0 then
    for i:=1 to 7 do
      if (a[i]<>t) and (a[i]<>a[1]) then begin
        write(a[i]);
        halt;
      end;
end.

{$M 17777777}
{$r-,q-,h+}

//Uses Brain;

Uses
	Math , SysUtils;

Const
	inf = 1 shl 30;
type
	int = int64;

var a : Array[-1..101] of char;

procedure swap(var a,b : char);
var c : char;
begin
 c:=a; a:=b; b:=c;
end;

procedure reading;
var n , i , j : longint; s : string;
begin
 readln(n);
 s:='ROYGBIV';
 j:=1;
 for i:=1 to n do begin
   	 a[i]:=s[j];
   	 inc(j);
         if j > 7 then j:=1;
 end;
 for i:=1 to  7 do begin
 	if (s[i] <> a[n - 1]) and (s[i] <> a[n - 2]) and (s[i] <> a[n - 3]) and
 	   (s[i] <> a[1]) and (s[i] <> a[2]) and (s[i] <> a[3]) then begin
 	    	a[n]:=s[i];
 	    	break;
 	   end;
 end;
 for i:=1 to n do write(a[i]);
end;

begin
 randomize;
  reading;
end.

var n,m,i,j,k:longint;
    a:array[0..201] of longint;
    pp:boolean;
    S:string;

function Podxod(num:longint):boolean;
begin
 if (a[num]<>a[num+1]) and
    (a[num]<>a[num+2]) and
    (a[num]<>a[num+3]) and
    (a[num]<>a[num-1]) and
    (a[num]<>a[num-2]) and
    (a[num]<>a[num-3]) then podxod:=true else
    podxod:=false;
end;

begin
fillchar(a,sizeof(a),0);
readln(n);
randomize;
a[1]:=random(7)+1;
a[2]:=random(7)+1;
while a[2]=a[1] do a[2]:=random(7)+1;
a[3]:=random(7)+1;
while (a[2]=a[3]) or (a[1]=a[3]) do a[3]:=random(7)+1;
a[n+1]:=a[1]; a[n+2]:=a[2]; a[n+3]:=a[3];
for i:= 4 to n-3 do
 begin
  a[i]:=random(7)+1;
  while (a[i]=a[i-1]) or (a[i]=a[i-2]) or (a[i]=a[i-3]) do
  a[i]:=random(7)+1;
 end;
 pp:=false;
 while pp=false do
  begin
   a[n]:=random(7)+1;
   a[n-1]:=random(7)+1;
   a[n-2]:=random(7)+1;
   if not Podxod(n) then pp:=false else
   if not Podxod(n-1) then pp:=false else
   if not Podxod(n-2) then pp:=false else
   pp:=true;
  end;
 s:='ROYGBIV';
 for i:= 1 to n do
  write(s[a[i]]);
  writeln;
end.

{$M 17777777}
{$r-,q-,h+}

//Uses Brain;

Uses
	Math , SysUtils;

Const
	inf = 1 shl 30;
type
	int = int64;

var a : Array[0..101] of char;

procedure swap(var a,b : char);
var c : char;
begin
 c:=a; a:=b; b:=c;
end;

procedure reading;
var n , i , j : longint; s : string;
begin
 readln(n);
 s:='ROYGBIV';
 j:=1;
 for i:=1 to n do begin
   	 a[i]:=s[j];
   	 inc(j);
         if j > 7 then j:=1;
 end;
 if n > 7 then
  swap(a[1] , a[5]);
 for i:=1 to n do write(a[i]);
end;

begin
 randomize;
  reading;
end.

var i,j,n,m:longint;
a:string;
begin
a:='ROYGBIVGBIVYGBIVOGBYVROYGBIV';
readln (n);
j:=1;
for i:=1 to n do
  begin
    if j<=28 then write (a[j])
    else j:=j-28;
    j:=j+1;
  end;
writeln ;
end.

program b70;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var n,i,j:integer;
    s:ansistring;
    col:array[0..6] of char = ('R','O','Y','G','B','I','V');
begin
  {$IFNDEF ONLINE_JUDGE}
  reset(input,'input.txt');
  rewrite(output,'output.txt');
  {$ENDIF}
  readln(n);
  s:='OYGBIVR';
  if odd(n) then for i:=8 to n do s:=s+col[i mod 3 +4] else
    for i:=8 to n do s:=s+col[i mod 4 + 3];
  writeln(s);
end.

Const col='ROYGBIV';{ fp }
Var
 n,j : longint;
 a : array[0..104] of longint;
 used : array[0..10] of longint;
 ok : boolean;

 Function good(x1,x2,x3,x4:longint):boolean;
  Begin
   If (x1=x2) or (x1=x3) or (x1=x4) or (x2=x3) or (x2=x4) or (x3=x4) then good := false
    else good := true;
  End;

 Procedure go(num:longint);
  Var
   i:longint;

  begin
   If num=n+1 then
    begin
     ok := true;
     a[n+1] := a[1];
     a[n+2] := a[2];
     a[n+3] := a[3];
     a[n+4] := a[4];
     For i := n-2 to n do
      If not good(a[i],a[i+1],a[i+2],a[i+3]) then
       Begin
        ok := false;
        break;
       End;
    If ok=false then exit;
     For i := 1 to n do
      Write(col[a[i]]);
     WriteLn;
     halt(0);
    end;
  If num>4 then  used[a[num-4]] := 0;
   For i := 1 to 7 do
    If used[i]=0 then
     Begin
      used[i] := 1;
      a[num] := i;
      go(num+1);
      used[i] := 0;
     End;
    if num>4 then  used[a[num-4]] := 1;
  end;

 Begin
  REad(n);
  go(1);
 end.

var n,i:longint;
begin
  read(n);
  write('ROIGBIV');
  for i:=1 to n-7 do
    if i mod 4=1 then write('G')
    else if i mod 4=2 then write('B')
    else if i mod 4=3 then write('I')
    else write('V');
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var n,i : longint;
    a : array[1..6] of string = ('R','RY','RYO','RYOG','RYOGB','RYOGBI');

begin
  readln(n);
  for i:=1 to (n div 7) do write('RYOGBIV');
  write(a[n mod 7]);
  readln;
end.

const c:set of char = ['a','e','u','i','o'];
var i,j,ans,n,p,k:longint;
    a:array [0..10000] of longint;
    s:ansistring;

    function max(x,y:longint):longint;
     begin
      if x> y then max:=x
       else max:=y;
      end;
begin
 readln(n);
 k:=1;

 for i:=1 to n do
  begin
   a[i]:=k;
   inc(k);
   if k=8 then k:=1;

  end;
 For i:=n downto max(n-3,8) do
  a[i]:=a[i-n div 2];

   for i:=1 to n do
    begin
     k:=a[i];
       if k=1 then write('R');
   if k=2 then write('O');
   if k=3 then write('Y');
   if k=4 then write('G');
    if k=5 then write('B');
     if k=6 then write('I');
      if k=7 then write('V');

    end;

end.

const c:set of char = ['a','e','u','i','o'];
var i,j,ans,n,m,k:longint;
    a:array [1..10000] of longint;
    s:ansistring;
begin
 readln(n);
 k:=1;
 for i:=1 to n do
  begin
  if (i=n-1) then
   begin
    write('Y'); inc(k);
    continue;
   end;
  if (i=n) then
   begin         inc(k);
    write('G');
    continue;
   end;
     if (i=n-2) then
   begin
    write('O'); inc(k);
    continue;
   end;

     if (i=n-3) then
   begin
    write('R');
     inc(k);
    continue;
   end;
   if k=1 then write('R');
   if k=2 then write('O');
   if k=3 then write('Y');
   if k=4 then write('G');
    if k=5 then write('B');
     if k=6 then write('I');
      if k=7 then write('V');

      inc(k);
      if k=8 then k:=1;
  end;
end.

program Project1112;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const
 a:array[1..7] of char = ('R','O','Y','G','B','I','V');
var
 i,j,k,n:integer;
 s:string;
begin
  { TODO -oUser -cConsole Main : Insert code here }
  readln(n);
   if n<=7 then
    for i:=1 to n do
     begin
      s:=s+a[i];
      exit;
     end;
  s:='ROYGBIV';
   while length(s)<n do
    begin
     j:=length(s)-3;
      s:=s+s[j];
    end;
  writeln(s);
end.

{ uses crt; }
 const nn=1000;
 label 1;
        type mas=array[0..nn] of longint; mass=^mas;
    var  s1,s2,m,l,r,w,p,n,i,j,k1,k2,t,min,imin:longint;  c,y:mas;
 u:boolean; s:char;

 x,ch:array[0..nn] of longint;
 rr,ll,ot:real;
 flag:boolean;
ss:array[0..nn]of char;
function sum(a,b:mas):mass; var   c:mas;i,j:integer;
begin  for i:=1 to nn do c[i]:=0;
for i:=nn downto 1 do begin c[i]:=(c[i]+a[i]+b[i]) mod 10; c[i-1]:=(a[i]+b[i]) div 10;    end;
sum:=@c;

  end;

function gl(a:char):boolean; var flag:boolean;
begin   flag:=false;
if (a='a')or (a='e')or (a='i')or(a='o')or(a='u') then flag:=true;
gl:=flag;
end;

     begin  {  clrscr;
     assign(input,'input.txt'); reset (input); }
ss[0]:='R';
ss[1]:='O';
ss[2]:='Y';
ss[3]:='G';
ss[4]:='B';
ss[5]:='I';
ss[6]:='V';
read(n);
if (n mod 7=0)or(n mod 7=6)or(n mod 7=5)or(n mod 7=4) then
   begin
       for i:=0 to n-1 do x[i]:=i mod 7;

   end;
if (n mod 7=1)or(n mod 7=2)or(n mod 7=3) then
   begin
        for i:=0 to ((n-1)div 7)*7 do x[i]:=i mod 7;
      x[n-1]:=3;x[n-2]:=2;x[n-3]:=1;

   end;

  { for i:=0 to n-1 do write(x[i],' '); write(' ');
   for i:=0 to n-1 do write(x[i],' '); }
   for i:=0 to n-1 do write(ss[x[i]]);

           end.

const
a:array[0..6] of char=('R','O','Y','G','B','I','V');
var
n,i,j:longint;
begin
 readln(n);
 for i:=1 to (n div 7)*7 do
        write(a[i mod 7]);
i:=i mod 7;
for j:=1 to n mod 7 do
        begin
        write(a[(i+2)mod 7]);
        inc(i);
        end;

end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var n,i : longint;
    a : array[1..6] of string = ('RYOGRBIV','RYOGRYBIV', 'RYOGRYOBIV', 'RYOGRYOGBIV', 'RYOGBRYOGBIV', 'RYOGBIRYOGBIV');

begin
  readln(n);
  for i:=1 to (n div 7)-1 do write('RYOGBIV');
  write(a[n mod 7]);
  readln;
end.

const
 s:array[0..6] of char = ('R','O','Y','G','B','I','V');
var
 i,n:longint;
 ans:array[0..1000] of char;
begin
 readln(n);
   for i:=1 to n do ans[i]:=s[i mod 7];
   if ans[n]=ans[1] then ans[n]:=ans[n-4];
   for i:=1 to n do write(ans[i]);
 writeln;
end.

const s:string='ROYG';
var n,m,j,i,k,l:longint;s1:string;

begin
{assign(input,'input.txt');reset(input);
assign(output,'output.txt');rewrite(output);}
readln(N);
m:=n div 4;
n:=n mod 4;
for i:=1 to m do
s1:=s1+s;
if n=1 then s1:=s1+'B' else
if n=1 then s1:=s1+'BI' else
if n=1 then s1:=s1+'BIV';
writeln(s1);

end.

program Project09;

{$APPTYPE CONSOLE}

uses
  SysUtils;
 var
 s:string;
n,i:integer;
begin
read(n);
s:='ROYGBIV';
For i:=1 to (n div 7-1) do
s:=s+s;
if n mod 7=0 then s:=s+'';
if n mod 7=1 then s:=s+'G';
if n mod 7=2 then s:=s+'GB';
if n mod 7=3 then s:=s+'GBI';
if n mod 7=4 then s:=s+'GBIV';
if n mod 7=5 then s:=s+'GBIVG';
if n mod 7=6 then s:=s+'GBIVGB';
writeln(s);
read(i);
end.

program Project09;

{$APPTYPE CONSOLE}

uses
  SysUtils;
 var
 s:string;
n,i:integer;
begin
read(n);
s:='ROYGBIV';
For i:=1 to (n div 7-1) do
s:=s+s;
if n mod 7=0 then s:=s+'';
if n mod 7=1 then s:=s+'G';
if n mod 7=2 then s:=s+'GB';
if n mod 7=3 then s:=s+'GBI';
if n mod 7=4 then s:=s+'GBIV';
if n mod 7=5 then s:=s+'GBIVY';
if n mod 7=6 then s:=s+'GBIVYG';
writeln(s);
read(i);
end.

Program B78;
Var
  n,kol : longint;
  stas : char;

Begin

  readln(n);
   n:=n-7;
    write('ROYGBIV');
   stas:='V';
  kol:=1;

  while n<>0 do
   begin
    inc(kol);
     write(stas);
    if kol=3
     then
      begin
       kol:=0;
        if stas='V' then stas:='I'
                    else stas:='V';
      end;
    dec(n);
   end;

End.

Var i,n,k,l:Integer;
    s,s1:String;
Begin
     Readln (n);
     s:='ROYGBIV';
     k:=n div 7;
     For I:=1 to k do
     Write (s);
     If (n-1) mod 7=0
     then Begin
               Writeln ('G');
     End
     else Begin
     s1:=Copy (s,1,n mod 7);
     Writeln (s1);
     End;
End.

const c:set of char = ['a','e','u','i','o'];
var i,j,ans,n,m,k:longint;
    a:array [1..10000] of longint;
    s:ansistring;
begin
 readln(n);
 k:=1;

 for i:=1 to 7 do
  begin
      if k=1 then write('R');
   if k=2 then write('O');
   if k=3 then write('Y');
   if k=4 then write('G');
    if k=5 then write('B');
     if k=6 then write('I');
      if k=7 then write('V');

      inc(k);
      if k=8 then k:=1;
  end;

 for i:=8 to n do
  begin
  if (i=n-1) then
   begin
    write('Y'); inc(k);
    continue;
   end;
  if (i=n) then
   begin         inc(k);
    write('G');
    continue;
   end;
     if (i=n-2) then
   begin
    write('O'); inc(k);
    continue;
   end;

     if (i=n-3) then
   begin
    write('R');
     inc(k);
    continue;
   end;
   if k=1 then write('R');
   if k=2 then write('O');
   if k=3 then write('Y');
   if k=4 then write('G');
    if k=5 then write('B');
     if k=6 then write('I');
      if k=7 then write('V');

      inc(k);
      if k=8 then k:=1;
  end;
end.

var i,j,n,m:longint;
a:string;
begin
a:='ROYGBIVGBIVYGBIVOGBYVROYGBIV';
readln (n);
j:=1;
for i:=1 to n do
  begin
    if j<=28 then write (a[j])
    else j:=j-28;
    j:=j+1;
  end;
writeln ;
end.

var
 n,i,j:longint;
 s,t:string;
 c:array[0..6]of char;
begin
 read(n);
 c[1]:='R';
 c[2]:='O';
 c[3]:='Y';
 c[4]:='G';
 c[5]:='B';
 c[6]:='I';
 c[0]:='V';
 if n>=11 then
  begin
   for i:=1 to n do
    write(c[i mod 7]);
   exit;
  end else
  begin
   for i:=0 to 6 do
    write(c[i]);
   for i:=8 to n do
    write(c[(i-4) mod 7]);
  end;
end.

var
 n,i,j:longint;
 s,t:string;
 c:array[0..6]of char;
begin
 read(n);
 c[1]:='R';
 c[2]:='O';
 c[3]:='Y';
 c[4]:='G';
 c[5]:='B';
 c[6]:='I';
 c[0]:='V';
 if n>=11 then
  begin
   for i:=1 to n do
    write(c[i mod 7]);
   exit;
  end else
  begin
   for i:=1 to 7 do
    write(c[i mod 7]);
   for i:=8 to n do
    write(c[(i-4) mod 7]);
  end;
end.

{$R+ Q+ I+}
{$APPTYPE CONSOLE}
uses
  SysUtils;
var
   n,i : integer;
   c : array [1..8] of char;

begin
     read(n);
     c[1] := 'R';
     c[2] := 'O';
     c[3] := 'Y';
     c[4] := 'G';
     c[5] := 'B';
     c[6] := 'I';
     c[7] := 'V';
     for i := 1 to n div 7 do write('ROYGRBIV');
     for i := 1 to n mod 7 do write(c[i]);
end.

var
n,i:longint;
begin
        readln (n);
        for i:=1 to n do
        if i mod 4=1 then
                write ('R')
        else
        begin
                if i mod 4=2 then
                        write ('O')
                else
                begin
                        if i mod 4=3 then
                                write ('Y')
                        else
                                write ('G');
                end;
        end;
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  str,ns,ns1,ns2,ns3,s:string;
  i,j,n,k,l,pos:integer;

begin
  readln(n);
  ns:='a';
  pos:=1;
  for i:=1 to n do
  begin
    Insert(ns,s,pos);
    Inc(pos);
  end;
  str:='ROYGBIV';
  if n<=7 then
    for i:=1 to n do
      s[i]:=str[i]
  else
  begin
    l:=n mod 7;
    k:=n div 7;
    if l<=4 then
    begin
      ns1:=Copy(str,1,4);
      ns2:=Copy(str,1,l);
      ns3:=Copy(str,5,3);
      s:=ns1+ns2+ns3;
      pos:=l+8;
    end
    else
    begin
      for i:=1 to l do
        s[i]:=str[i];
      pos:=l+1;
    end;
    for i:=1 to k do
      for j:=1 to 7 do
        s[pos+j-1]:=str[j];
  end;
  writeln(s);
  readln;
end.

var
n,i:longint;
begin
        readln (n);
        for i:=1 to n do
        if i mod 7=1 then
                write ('R')
        else
        begin
                if i mod 7=2 then
                        write ('O')
                else
                begin
                        if i mod 7=3 then
                                write ('Y')
                        else
                        begin
                                if i mod 7=4 then
                                        write ('G')
                                else
                                begin
                                        if i mod 7=5 then
                                                write ('B')
                                        else
                                        begin
                                                if i mod 7=6 then
                                                        write ('I')
                                                else
                                                        write ('V');
                                        end;
                                end;
                        end;
                end;
        end;
end.

const fi = '';
        fo = '';
        C : array[1..7] of char = ('R','O','Y','G','B','I','V');
var
        f : text;
        n,i,j : longint;
begin
        Assign(f,fi);
        reset(f);
        readln(f,n);
        Close(f);
        Assign(f,fo);
        rewrite(f);
        j := 0;
        For i := 1 to n do
        Begin
                inc(j);
                if j = 8 then j := 1;
                Write(f,C[j]);
        End;
        Close(f);
End.

Var
n,i,k,j:longint;
s:string;
Begin
read(n);
s:='ROYGBIV';
for i:=1 to (n div 7)-1 do
 write(s);write('ROYG');
for i:=1 to (n mod 7) do
 write(s[i]);
if (n mod 7)<=4 then write('BIV') else
 Begin
 for i:=(n mod 7)+1 to (n mod 7)+3 do
 if i<=7 then
  write(s[i]) else break;
  k:=i-((n mod 7)+1);
 for j:=i-4 to i-(k+1) do
  write(s[j]);
 end;
end.

var  i,k:integer;
begin
readln(k);
if k mod 7 =0 then write('ROYGBIV');
if k mod 8 =0 then write('ROYGRBIV');
if k mod 13 =0 then write('ROYGBIVGBIVYG');
if (k mod 2 =0) and(k mod 8<>0) then write('ROYGROYG');
if (k mod 5 =0)  then write('ROYGIROYGI');
if (k mod 6 =0)  then write('ROYGIVROYGIV');
end.

program z;
 const
  ar:array[1..7] of char=('R','G','B','O','Y','I','V');
 var
  a:array[1..103] of char;
  n,i,j:integer;
 begin
  read(n);
  a[1]:='R';
  a[2]:='G';
  a[3]:='B';
  a[4]:='O';
  a[5]:='Y';
  a[6]:='I';
  a[7]:='U';
  a[n+1]:='R';
  a[n+2]:='G';
  a[n+3]:='B';
  for i:=8 to n-3 do
   begin
    for j:=1 to 7 do
     begin
      if (a[i-1]<>ar[j])and(a[i-2]<>ar[j])and(a[i-3]<>ar[j])
       then
        begin
         a[i]:=ar[j];
         break;
        end;
     end;
   end;
  for i:=n-3 to n do
   begin
    for j:=1 to 7 do
     begin
      if (a[i-1]<>ar[j])and(a[i-2]<>ar[j])and(a[i-3]<>ar[j])and
         (a[i+1]<>ar[j])and(a[i+2]<>ar[j])and(a[i+3]<>ar[j])
       then
        begin
         a[i]:=ar[j];
         break;
        end;
     end;
   end;
  for i:=1 to n do write(a[i]);
end.

var a,i:integer; s,s1:string;
begin
read(a);
s:='ROYGBIV';
for i:=1 to a div 7 do
write(s);
for i:=1 to a mod 7 do
write(s[i+3]);
end.

const
a:array[0..6] of char=('R','O','Y','G','B','I','V');
var
n,i,j:longint;
begin
 readln(n);
 for i:=1 to (n div 7)*7 do
        write(a[i mod 7]);
i:=i mod 7;
if n=8 then
begin
write('B');
halt;
end
else
if n=9 then
begin
write('IG');
halt;
end;
for j:=1 to n mod 7 do
        begin
        write(a[(i+2)mod 7]);
        inc(i);
        end;

end.

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  n:integer;
  i:integer;
  s:string='ROYGBIV';
begin
  readln(n);

  for i:=1 to 7*(n div 7) do
  begin
    if s<>'' then
    begin
      write(s[1]);
      delete(s,1,1);
    end
      else
        begin
          write('R');
          s := 'OYGBIV';
        end;
  end;

  s := 'ROYGBIV';

  for i:=7*(n div 7) to n-1 do
    write(s[i-3]);
end.

program Project1112;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const
 a:array[1..7] of char = ('R','O','Y','G','B','I','V');
var
 i,j,k,n:integer;
 s:string;
begin
  { TODO -oUser -cConsole Main : Insert code here }
  readln(n);
   if n<=7 then
    for i:=1 to n do
     begin
      s:=s+a[i];
      exit;
     end;
  s:='ROYGBIV';
   while length(s)<n do
    begin
     j:=length(s)-3;
      s:=s+s[j];
    end;
  writeln(s);
end.

var   n,i,j:longint;
s,s1:string;
ch:char;
begin
{assign(input,'input.txt');
reset(input);
assign(output,'output.txt');
rewrite(output);}
read(n);
s:='';
s1:='VROYGBI';
for i:=1 to n do
 s:=s+s1[i mod 7+1];
if s[1]=s[n] then
 begin
  ch:=s[n];
  s[n]:=s[n-1];
  s[n-1]:=s[n-2];
  s[n-2]:=s[n-3];
  s[n-3]:=ch;
 end;
write(s);
{close(input);
close(output);}
end.

program b70;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var n,i,j:integer;
    col:array[0..6] of char = ('R','O','Y','G','B','I','V');
begin
  {$IFNDEF ONLINE_JUDGE}
  reset(input,'input.txt');
  rewrite(output,'output.txt');
  {$ENDIF}
  readln(n);
  for i:=1 to n do write(col[i mod 7]);
end.

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  n:integer;
  i:integer;
  s:string='ROYGBIV';
begin
  readln(n);
  for i:=1 to n-4 do
  begin
    if s<>'' then
    begin
      write(s[1]);
      delete(s,1,1);
    end
      else
        begin
          write('G');
          s :='ROYGBIV';
        end;
  end;

  for i:=1 to n-4 do
  begin
    if s<>'' then
    begin
      write(s[1]);
      delete(s,1,1);
    end
      else
        begin
          write('G');
          s :='ROYGBIV';
        end;
  end;
end.

const a:array[1..8] of char=('R','O','Y','G','R','B','I','V');
var n:integer;
procedure form;
var i:integer;
begin
 for i:=1 to n do
 write(a[i mod 8+1]);
end;

BEGIN
 readln(n);
 form;
END.

var
 met:array [1..1000] of longint;
 i,j,n,m,k,l:longint;
 c:char;
 s,s1,ss:string;
begin
 readln(n);
 ss:='OYGBIV';
 l:=1;
 for i:=1 to n do
  begin
   met[i]:=l;
   inc(l);
   inc(k);
   if k>3 then
                begin
                 met[i]:=-1;
                 k:=0;
                 dec(l);
                end;
   if l>6 then l:=1;
  end;
  for i:=1 to n do
   if met[i]<>-1 then write(ss[met[i]])
    else write('R');
end.

uses math;
var
  n:longint;
  i:longint;
begin
  readln(n);

  n:=n-7;
  write('ROYGBIV');

  for i:=1 to n div 4 do
    write('ROYG');
  case n mod 4 of
    1: write('R');
    2: write('RO');
    3: write('ROY');
  end;
end.

var
 met,mm:array [1..10000] of longint;
 i,j,n,m,k:longint;
 s:string;
begin
 s:='ROYGBIV';
 readln(n);
 for i:=1 to 7 do
  met[i]:=i;
  j:=8;
 for i:=8 to n-2 do
  begin
   met[j]:=((i-1) mod 7)+1;
   inc(j);
  end;
 mm[1]:=1;
 for i:=n-3 downto n-5 do
  mm[met[i]]:=1;
 for i:=1 to 7 do
  if mm[i]<>1 then begin
                    met[n-2]:=i;
                    break;
                   end;
 fillchar(mm,sizeof(mm),0);
 mm[1]:=1;
 mm[2]:=1;
 for i:=n-2 downto n-4 do
  mm[met[i]]:=1;
 for i:=1 to 7 do
  if mm[i]<>1 then begin
                    met[n-1]:=i;
                    break;
                   end;
 fillchar(mm,sizeof(mm),0);
 mm[1]:=1;
 mm[2]:=1;
 mm[3]:=1;
 for i:=n-1 downto n-3 do
  mm[met[i]]:=1;
 for i:=1 to 7 do
  if mm[i]<>1 then begin
                    met[n]:=i;
                    break;
                   end;
 for i:=1 to n do
  begin
   write(s[met[i]]);
  end;
end.

{$M 17777777}
{$r-,q-,h+}

//Uses Brain;

Uses
	Math , SysUtils;

Const
	inf = 1 shl 30;
type
	int = int64;

var a : Array[0..101] of char;

procedure reading;
var n , i , j : longint; s : string;
begin
 readln(n);
 s:='ROYGBIV';
 j:=1;
 for i:=1 to n do begin
   	 a[i]:=s[j];
   	 inc(j);
         if j > 7 then j:=1;
 end;
 while (a[1] = a[n]) or (a[1] = a[n - 1]) or (a[1] = a[n - 2]) or (a[1] = a[2]) or
       (a[1] = a[3]) or (a[1] = a[4]) do begin
  	j:= 1 + random(6);
 	a[1]:= s[j];
 end;
 for i:=1 to n do write(a[i]);
end;

begin
 randomize;
  reading;
end.

const a:array[1..8] of char=('R','O','Y','G','R','B','I','V');
      b:array[1..4] of char=('R','B','I','V');
var n:integer;
    m:array[1..200] of char;

procedure form;
var i:integer;may:set of char;
begin
 for i:=1 to n do
  if n<=3 then write(a[i])
  else write(b[i mod 4+1]);
end;

BEGIN
 readln(n);
 form;
END.

var  i,k:integer;
begin
readln(k);
if k mod 7 =0 then write('ROYGBIV');
if k mod 8 =0 then write('ROYGRBIV');
if k mod 13 =0 then write('ROYGBIVGBIVYG');
if (k mod 4 =0) and(k mod 8<>0) then write('ROYGROYG');
if (k mod 5 =0)  then write('ROYGIROYGI');
if (k mod 6 =0)  then write('ROYGIVROYGIV');
end.

var
 n,i,j,k,m,h,c,x,z : longint;
 s,ss,p,t : ansistring;
begin
 readln(n);
 if n=7 then
 begin
  writeln('ROYGBIV');
  halt;
 end;
 for i:=1 to n div 7 do write('ROYGBIV');
 for i:=1 to n mod 7 do
  if i=1 then write('R') else
  if i=2 then write('O') else
  if i=3 then write('Y') else
  if i=4 then write('G') else
  if i=5 then write('B') else
  if i=5 then write('I');
 writeln;
end.

var  i,k:integer;
begin
readln(k);
if k mod 7 =0 then write('ROYGBIV');
if k mod 8 =0 then write('ROYGRBIV');
if k mod 13 =0 then write('ROYGBIVGBIVYG');
if (k mod 2 =0) and(k mod 8<>0) then write('ROYGROYG');
if (k mod 5 =0)  then write('ROYGIROYGI');
if (k mod 6 =0)  then write('ROYGIVROYGIV');
end.

var n,i:byte;
begin
read(n);
for i:=1 to (n div 7)*7 do
case i mod 7 of
0:write('V');
1:write('R');
2:write('O');
3:write('Y');
4:write('G');
5:write('I');
6:write('B');
end;
case n mod 7 of
1:write('G');
2:write('GY');
3:write('ROY');
4:write('ROYG');
5:write('ROYGI');
6:write('ROYGIB');
end;
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

Var
  n, i, h, h1, h2, j : integer;
  s : string;
  vis : array[1..7] of boolean;
  a : array[1..7] of string;
begin

  readln(n);
  a[1] := 'R';
  a[2] := 'O';
  a[3] := 'Y';
  a[4] := 'G';
  a[5] := 'B';
  a[6] := 'I';
  a[7] := 'V';

  s := 'ROYGRBI';
  for i := 8 to n do begin
    for j := 1 to 7 do
      vis[j] := false;
    for j := 1 to 3 do begin
      if s[i - j] = 'R' then
        vis[1] := true;
      if s[i - j] = 'O' then
        vis[2] := true;
      if s[i - j] = 'Y' then
        vis[3] := true;
      if s[i - j] = 'G' then
        vis[4] := true;
      if s[i - j] = 'B' then
        vis[5] := true;
      if s[i - j] = 'I' then
        vis[6] := true;
      if s[i - j] = 'V' then
        vis[7] := true;
    end;
    for j := 1 to 3 do begin
      if ((i + j) mod n <= length(s)) and  (s[(i + j) mod n] = 'R') then
        vis[1] := true;
      if ((i + j) mod n <= length(s)) and  (s[(i + j) mod n] = 'O') then
        vis[2] := true;
      if ((i + j) mod n <= length(s)) and  (s[(i + j) mod n] = 'Y') then
        vis[3] := true;
      if ((i + j) mod n <= length(s)) and  (s[(i + j) mod n] = 'G') then
        vis[4] := true;
      if ((i + j) mod n <= length(s)) and  (s[(i + j) mod n] = 'B') then
        vis[5] := true;
      if ((i + j) mod n <= length(s)) and  (s[(i + j) mod n] = 'I') then
        vis[6] := true;
      if ((i + j) mod n <= length(s)) and  (s[(i + j) mod n] = 'V') then
        vis[7] := true;
    end;
    for j := 1 to 7 do
      if vis[j] <> true then begin
        s := s + a[j];
        break;
      end;
  end;

  writeln(s);
end.

var n,i:byte;
begin
read(n);
for i:=1 to (n div 7)*7 do
case i mod 7 of
0:write('V');
1:write('R');
2:write('O');
3:write('Y');
4:write('G');
5:write('I');
6:write('B');
end;
if n mod 7=1 then write('G');
if n mod 7=2 then write('GY');
end.

const a:array [1..7] of char = ('R','O','Y','G','B','I','V');
var n,m,j,i,k,l:longint;s:string;

begin
{assign(input,'input.txt');reset(input);
assign(output,'output.txt');rewrite(output);}
readln(N);
m:=n mod 7;
k:=1;
for i:=1 to n do
if (i mod 5=0)and (m>=1) then
        begin
         s:=s+s[i-4];
         dec(m);
        end
        else
        begin
         s:=s+ a[k];
         inc(k);
         if k>7 then k:=1;
        end;
writeln(s);
end.

uses math;

const kt:array[0..6]of char=('R','Y','O','I','B','G','V');
var i,n:longint;
       s:string;
begin
  readln(n);
            s:='';
  for i:=1 to 7 * (n div 7) do
     begin
      s:=s+kt[i mod 7];
     end;

    case n mod 7 of
    1:s:=s+kt[3];
    2: begin
       s:=s+kt[3]+kt[4];
    end;
    3: begin
       s:=s+kt[3]+kt[4] +kt[5];
    end;
    4: begin
       s:=s+kt[3]+kt[4]+kt[5]+kt[6];
    end;
    5: begin
       s:=s+kt[3]+kt[2]+kt[4]+kt[5]+kt[6];
    end;
    6:begin
    s:=s+kt[3]+kt[2]+kt[1]+kt[4]+kt[5]+kt[6];
      end;
    end;
    writeln(s);
end.

program d;
var
     a,b : array [1..111] of char;
       c : char;
i,j,n,i1 : integer;
       f : boolean;
BEGIN
b[1]:='R';
b[2]:='O';
b[3]:='Y';
b[4]:='G';
b[5]:='B';
b[6]:='I';
b[7]:='V';
readln (n);

for i:=1 to 7 do a[i]:=b[i];
for I:=8 to n do
   for i1:=1 to 7 do
        begin
	f:=false;
        for j:=1 to 3 do
               begin
               if i+j>n then c:=a[(i+j) mod n] else c:=a[i+j];
	       if (a[i-j]=b[i1]) or (c=b[i1]) then f:=true;
  	       end;
        if not f then a[i]:=b[i1];
	end;
for i:=1 to n do write (a[i],' ');

END.