with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;

procedure Solve is
   R : Integer;
begin
   Get (R);
   if R < 1200 then
      Put_Line ("ABC");
   elsif R < 2800 then
      Put_Line ("ARC");
   else
      Put_Line ("AGC");
   end if;
end Solve;