'use strict'

function main(input) {

    let ans = 'AGC'

    input = Number(input)
    if (input < 1200){
        ans = "ABC"
    }else if(input < 2800){

        ans = "ARC"
    }
    console.log(ans)

}

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