'use strict'

function main(input) {

  const rate = Number(input);
  let ans = '';

  if (rate < 1200) {
    ans = 'ABC';
  } else if (rate < 2800) {
    ans = 'ARC';
  } else {
    ans = 'AGC';
  }

  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
