#include <stdio.h>
int main() {
int T; // Declare variable for number of test cases
scanf("%d", &T); // Read number of test cases
while (T--) { // Loop T times, decrementing T after each iteration
// (runs while T > 0, each time T decreases by 1)
int K; // Declare variable for number of operations
scanf("%d", &K); // Read the number of operations for this test case
char str[] = "RGB"; // Initialize string with original pen order for each test case
char temp; // Temporary variable to swap characters
for (int i = 1; i <= K; i++) { // Loop from 1 to K (for each operation)
if (i % 2 == 1) { // If operation number is odd
// Odd operation: move leftmost pen to middle
// Swap first and second characters: str[0] <-> str[1]
temp = str[0];
str[0] = str[1];
str[1] = temp;
} else {
// Even operation: move rightmost pen to middle
// Swap third and second characters: str[2] <-> str[1]
temp = str[2];
str[2] = str[1];
str[1] = temp;
}
}
printf("%s\n", str); // Print final string after K operations for this test case
}
return 0; // End of program
}