#include <bits/stdc++.h>
#define endl "\n"
#define INT long long int

using namespace std;

char infile[100], outfile[100];
char S[300000];
INT n, l, r, x, y;
int main() {
    ios::sync_with_stdio(false);
    INT T, n, i,j,A, a,I,o,e;
    cin >> T;
    for(I=1;I<=T;I++){
        sprintf(infile, ".%d.in", I);
        freopen(infile, "w", stdout);
        
        scanf("%lld",&n);
        printf("%lld",n);
        		
        sprintf(outfile, ".%d.out", I);
        freopen(outfile, "w", stdout);
        if( n%2 ) printf("G");
    	else printf("S");
    }
}
