description: As their story unravels, a timeless tale is told once again...
  
  Shirahime, a friend of Mocha's, is keen on playing the music game Arcaea and sharing Mocha interesting puzzles to solve. This day, Shirahime comes up with a new simple puzzle and wants Mocha to solve them. However, these puzzles are too easy for Mocha to solve, so she wants you to solve them and tell her the answers. The puzzles are described as follow.
  
  There are n squares arranged in a row, and each of them can be painted either red or blue.
  
  Among these squares, some of them have been painted already, and the others are blank. You can decide which color to paint on each blank square.
  
  Some pairs of adjacent squares may have the same color, which is imperfect. We define the imperfectness as the number of pairs of adjacent squares that share the same color.
  
  For example, the imperfectness of "BRRRBBR" is 3, with "BB" occurred once and "RR" occurred twice.
  
  Your goal is to minimize the imperfectness and print out the colors of the squares after painting. 
  
  Input
  
  Each test contains multiple test cases. 
  
  The first line contains a single integer t (1 ≤ t ≤ 100) — the number of test cases. Each test case consists of two lines.
  
  The first line of each test case contains an integer n (1≤ n≤ 100) — the length of the squares row.
  
  The second line of each test case contains a string s with length n, containing characters 'B', 'R' and '?'. Here 'B' stands for a blue square, 'R' for a red square, and '?' for a blank square.
  
  Output
  
  For each test case, print a line with a string only containing 'B' and 'R', the colors of the squares after painting, which imperfectness is minimized. If there are multiple solutions, print any of them.
  
  Example
  
  Input
  
  
  5
  7
  ?R???BR
  7
  ???R???
  1
  ?
  1
  B
  10
  ?R??RB??B?
  
  
  Output
  
  
  BRRBRBR
  BRBRBRB
  B
  B
  BRRBRBBRBR
  
  Note
  
  In the first test case, if the squares are painted "BRRBRBR", the imperfectness is 1 (since squares 2 and 3 have the same color), which is the minimum possible imperfectness.
solution: import java.io.*;
  import java.math.*;
  import java.text.DecimalFormat;
  import java.util.*;
  
  public class Main {
      static final int INF = (int) (1e9 + 10);
      static final long MOD = (int) (1e9 + 7);
      static final int N = (int) (4e5 + 5);
  
      // static ArrayList<Integer> graph[];
      // static boolean visited[];
      // static long size[];
  
      public static void main(String[] args) throws NumberFormatException, IOException {
          FastReader sc = new FastReader();
          PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
          BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
          // Scanner sc = new Scanner(System.in);
          //
          int t=sc.nextInt();
          while(t--!=0){
              int n = sc.nextInt();
              String s= sc.next();
              char[] str = s.toCharArray();
  
              int cnt = 0;
              for(char ch:str)
                  cnt+= (ch!='?')?1:0;
              if(cnt == 0)
                  str[0] = 'R';
              for(int i=1;i<n;i++){
                  if(str[i]=='?'&&str[i-1]!='?')
                  str[i] = (char) (str[i-1]^('B'^'R'));
              }
              for(int i=n-2;i>=0;i--){
                  if(str[i]=='?'&&str[i+1]!='?')
                      str[i] = (char) (str[i+1]^('B'^'R'));
              }
  
              System.out.println(String.valueOf(str));
              //pr.println("Case #"+(z-t)+": "+());
          }
  
          //
          //
          pr.flush();
          pr.close();
          br.close();
  
      }
  
      /*
       * Template From Here
       */
      private static long gdcmod7(long x,long y,long m){
          long res = 1;
          x=x%m;
          if(x==0) return 0;
          while(y>0){
              if((y&1)==1)
                  res = (res*x)%m;
              y = y>>1;
              x = (x*x)%m;
          }
          return res;
      }
      private static boolean possible(String s, int mid, int k) {
          int c = 0, ln = 0;
          int idx = -2;
          for (int i = 0; i < s.length(); i++) {
              c++;
              if (s.charAt(i) == ' ' || s.charAt(i) == '-') {
                  idx = i;
              }
              if (c >= mid) {
                  c = i - idx;
                  System.out.println(c + " " + i + " " + idx);
                  if (c > mid)
                      return false;
                  ln++;
              }
          }
          System.out.println(mid + " " + ln + " " + k);
          if (ln <= k)
              return true;
          return false;
      }
  
      static void sort(long[] a) {
          ArrayList<Long> l = new ArrayList<>();
          for (long i : a)
              l.add(i);
          Collections.sort(l);
          for (int i = 0; i < a.length; i++)
              a[i] = l.get(i);
      }
  
      static void sort(double[] a) {
          ArrayList<Double> l = new ArrayList<>();
          for (double i : a)
              l.add(i);
          Collections.sort(l);
          for (int i = 0; i < a.length; i++)
              a[i] = l.get(i);
      }
  
      static void sort(int[] a) {
          ArrayList<Integer> l = new ArrayList<>();
          for (int i : a)
              l.add(i);
          Collections.sort(l);
          for (int i = 0; i < a.length; i++)
              a[i] = l.get(i);
      }
  
      public static int lowerBound(ArrayList<Integer> array, int length, long value) {
          int low = 0;
          int high = length;
          while (low < high) {
              final int mid = (low + high) / 2;
              if (value <= array.get(mid)) {
                  high = mid;
              } else {
                  low = mid + 1;
              }
          }
          return low;
      }
  
      public static long mul(long a, long b) {
          return (a * b) % MOD;
      }
  
      static class FastReader {
          BufferedReader br;
          StringTokenizer st;
  
          public FastReader() {
              br = new BufferedReader(new InputStreamReader(System.in));
          }
  
          String next() {
              while (st == null || !st.hasMoreElements()) {
                  try {
                      st = new StringTokenizer(br.readLine());
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
              }
              return st.nextToken();
          }
  
          int nextInt() {
              return Integer.parseInt(next());
          }
  
          long nextLong() {
              return Long.parseLong(next());
          }
  
          double nextDouble() {
              return Double.parseDouble(next());
          }
  
          String nextLine() {
              String str = "";
              try {
                  str = br.readLine();
              } catch (IOException e) {
                  e.printStackTrace();
              }
              return str;
          }
  
          public int[] nextIntArray(int n) {
              int[] a = new int[n];
              for (int i = 0; i < n; i++)
                  a[i] = nextInt();
              return a;
          }
  
          public long[] nextLongArray(int n) {
              long[] a = new long[n];
              for (int i = 0; i < n; i++)
                  a[i] = nextLong();
              return a;
          }
      }
  
      static long gcd(long a, long b) {
          if (a == 0)
              return b;
          return gcd(b % a, a);
      }
  
      static long lcm(long a, long b) {
          return (a * b) / gcd(a, b);
      }
  
      public static void sortbyColumn(int[][] att, int col) {
          // Using built-in sort function Arrays.sort
          Arrays.sort(att, new Comparator<int[]>() {
  
              @Override
              // Compare values according to columns
              public int compare(final int[] entry1, final int[] entry2) {
  
                  // To sort in descending order revert
                  // the '>' Operator
                  // if (entry1[col] > entry2[col])
                  // return 1;
                  // else //(entry1[col] >= entry2[col])
                  // return -1;
                  return new Integer(entry1[col]).compareTo(entry2[col]);
                  // return entry1[col].
              }
          }); // End of function call sort().
      }
  
      public static void sortbyColumn(double[][] att, int col) {
          // Using built-in sort function Arrays.sort
          Arrays.sort(att, new Comparator<double[]>() {
  
              @Override
              // Compare values according to columns
              public int compare(final double[] entry1, final double[] entry2) {
  
                  // To sort in descending order revert
                  // the '>' Operator
                  // if (entry1[col] > entry2[col])
                  // return 1;
                  // else //(entry1[col] >= entry2[col])
                  // return -1;
                  return new Double(entry1[col]).compareTo(entry2[col]);
                  // return entry1[col].
              }
          }); // End of function call sort().
      }
  
      public static void sortbyColumn(long[][] att, int col) {
          Arrays.sort(att, new Comparator<long[]>() {
              @Override
              public int compare(final long[] entry1, final long[] entry2) {
                  return new Long(entry1[col]).compareTo(entry2[col]);
              }
          });
      }
  
      static class pair {
          int V, I;
  
          pair(int v, int i) {
              V = v;
              I = i;
          }
      }
  
      public static int[] swap(int data[], int left, int right) {
          int temp = data[left];
          data[left] = data[right];
          data[right] = temp;
          return data;
      }
  
      public static int[] reverse(int data[], int left, int right) {
          while (left < right) {
              int temp = data[left];
              data[left++] = data[right];
              data[right--] = temp;
          }
          return data;
      }
  
      public static boolean findNextPermutation(int data[]) {
          if (data.length <= 1)
              return false;
  
          int last = data.length - 2;
          while (last >= 0) {
              if (data[last] < data[last + 1]) {
                  break;
              }
              last--;
          }
          if (last < 0)
              return false;
  
          int nextGreater = data.length - 1;
          for (int i = data.length - 1; i > last; i--) {
              if (data[i] > data[last]) {
                  nextGreater = i;
                  break;
              }
          }
          data = swap(data, nextGreater, last);
          data = reverse(data, last + 1, data.length - 1);
          return true;
      }
  
      static long ncrmod(long a, long b) {
          if (b > a - b)
              return ncr(a, a - b);
          long ansMul = 1;
          long ansDiv = 1;
          for (int i = 0; i < b; i++) {
              ansMul *= (a - i);
              ansDiv *= (i + 1);
              ansMul %= MOD;
              ansDiv %= MOD;
          }
  
          long ans = ansMul * power(ansDiv, MOD - 2, MOD) % MOD;
  
          return ans;
      }
  
      static long ncr(long n, long r) {
          long p = 1, k = 1;
          if (n - r < r) {
              r = n - r;
          }
          if (r != 0) {
              while (r > 0) {
                  p *= n;
                  k *= r;
                  long m = __gcd(p, k);
                  p /= m;
                  k /= m;
  
                  n--;
                  r--;
              }
  
          } else {
              p = 1;
          }
  
          return p;
      }
  
      static long __gcd(long n1, long n2) {
          long gcd = 1;
  
          for (int i = 1; i <= n1 && i <= n2; ++i) {
              // Checks if i is factor of both integers
              if (n1 % i == 0 && n2 % i == 0) {
                  gcd = i;
              }
          }
          return gcd;
      }
  
      static long power(long prev, long n2, long mod2) {
          long res = 1;
  
          prev = prev % mod2;
  
          if (prev == 0)
              return 0;
          while (n2 > 0) {
  
              if ((n2 & 1) == 1)
                  res = (res * prev) % mod2;
  
              n2 = n2 >> 1;
              prev = (prev * prev) % mod2;
          }
          return res;
      }
  
      static long modInverse(long fac2, int p) {
          return power(fac2, p - 2, p);
      }
  
      static boolean isPrime(int n) {
          // Corner cases
          if (n <= 1)
              return false;
          if (n <= 3)
              return true;
  
          // This is checked so that we can skip
          // middle five numbers in below loop
          if (n % 2 == 0 || n % 3 == 0)
              return false;
  
          for (int i = 5; i * i <= n; i = i + 6)
              if (n % i == 0 || n % (i + 2) == 0)
                  return false;
  
          return true;
      }
  
      public static BigInteger lcmm(String a, String b) {
          BigInteger s = new BigInteger(a);
          BigInteger s1 = new BigInteger(b);
          BigInteger mul = s.multiply(s1);
          BigInteger gcd = s.gcd(s1);
          BigInteger lcm = mul.divide(gcd);
          return lcm;
      }
      /*
       * static boolean prime[] = new boolean[10000007]; static int spf[] = new
       * int[10000007];
       *
       * public static void sieveOfEratosthenes(int n) { for (int i = 2; i < n;
       * i++) prime[i] = true; for (int p = 2; p * p <= n; p++) {
       *
       * if (prime[p] == true) {
       *
       * for (int i = p * p; i <= n; i += p) { prime[i] = false; spf[i] = p; } } }
       * }
       */
  }
  