func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     string s;     int n, sumA = 0, sumG = 0;     cin >> n;     vector<pair<int, int>> vec(n);     for (int i = 0; i < n; i++) cin >> vec[i].first >> vec[i].second;     if (vec[0].first > vec[0].second) {       sumG = vec[0].second;       s.push_back( G );     } else {       sumA = vec[0].first;       s.push_back( A );     }     for (int i = 1; i < n; i++) {       if (sumA + vec[i].first - sumG <= 500) {         sumA += vec[i].first;         s.push_back( A );       } else {         sumG += vec[i].second;         s.push_back( G );       }     }     if (abs(sumA - sumG) <= 500)       cout << s;     else       cout << -1;     return 0;   }   