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


