program main
	implicit none
    integer::a
    read(*,*)a
    if(a<1200)then
    	write(*,*)'ABC'
    else if(a<2800)then
    	write(*,*)'ARC'
    else
    	write(*,*)'AGC'
    end if
    stop
end program main