#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define repr(i,a,b) for(int i=a; i>=b; i--)
#define fi first
#define se second
#define ll long long
#define endl "\n"
#define pb push_back
#define ii pair <int, int>
#define all(a) a.begin(), a.end()
#define mod 1000000007ll
#define ma 100005

void process(){
    int n;
	cin >> n;
	rep(i, 1, n) cin >> a[i];
	ll sum = 0;
	rep(i, 1, n) sum += a[i];
	sum /= n;
	cout << 3 * (n - 1) << endl;
	rep(i, 2, n) {
	    cout << "1 " << i << ' ' << i - a[i]%i << endl;
		a[1] -= i - a[i]%i;
		a[i] += i - a[i]%i;
		cout << i << " 1 " << (a[i] / i) << endl;
		a[1] += (a[i] / i)*i;
		a[i] -= (a[i] / i)*i;
	}
	rep(i, 2, n) {
		cout << "1 " << i << ' ' << sum << endl;
		//a[1] += (a[i] / i)*i;
	}
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
//	freopen("Test.inp", "r", stdin);
	//freopen("Test.out", "w", stdout);
    int t;
    cin>>t;
    while(t--){
        process();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define repr(i,a,b) for(int i=a; i>=b; i--)
#define fi first
#define se second
#define ll long long
#define endl "\n"
#define pb push_back
#define ii pair <int, int>
#define all(a) a.begin(), a.end()
#define mod 1000000007ll
#define ma 10005
int a[ma];

void process(){
    int n;
	cin >> n;
	rep(i, 1, n) cin >> a[i];
	ll sum = 0;
	rep(i, 1, n) sum += a[i];
	sum /= n;
	cout << 3 * (n - 1) << endl;
	rep(i, 2, n) {
	    cout << "1 " << i << ' ' << i - a[i]%i << endl;
		a[1] -= i - a[i]%i;
		a[i] += i - a[i]%i;
		cout << i << " 1 " << (a[i] / i) << endl;
		a[1] += (a[i] / i)*i;
		a[i] -= (a[i] / i)*i;
	}
	rep(i, 2, n) {
		cout << "1 " << i << ' ' << sum << endl;
		//a[1] += (a[i] / i)*i;
	}
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
//	freopen("Test.inp", "r", stdin);
	//freopen("Test.out", "w", stdout);
    int t;
    cin>>t;
    while(t--){
        process();
    }
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <climits>
#include <queue>
#include <cstring>
#include <stack>
#include <ctime>
using namespace std;
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define repr(i,a,b) for(int i=a; i>=b; i--)
#define fi first
#define se second
#define ll long long int
#define endl "\n"
#define pb push_back
#define ii pair <int, int>
#define all(a) a.begin(), a.end()
#define mod 1000000007ll
#define ma 300005
ll a[ma];

void process() {
	int n;
	cin >> n;
	rep(i, 1, n) cin >> a[i];
	ll sum = 0;
	rep(i, 1, n) sum += a[i];
	sum /= n;
	cout << 3 * (n - 1) << endl;
	rep(i, 2, n) {
		cout << i << " 1 " << (a[i] / i) << endl;
		a[1] += (a[i] / i)*i;
		a[i] -= (a[i] / i)*i;
	}
	rep(i, 2, n) {
		cout << "1 " << i << ' ' << i - a[i] << endl;
		a[1] -= i - a[i];
		a[i] = i;
	}
	rep(i, 2, n) {
		cout << i << " 1 1" << endl;
		//a[1] += (a[i] / i)*i;
	}
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
	//freopen("Test.inp", "r", stdin);
	//freopen("Test.out", "w", stdout);
	int t;
	cin >> t;
	while (t--) {
		process();
	}
	//process();
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <climits>
#include <queue>
#include <cstring>
#include <stack>
#include <ctime>
using namespace std;
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define repr(i,a,b) for(int i=a; i>=b; i--)
#define fi first
#define se second
#define ll long long int
#define endl "\n"
#define pb push_back
#define ii pair <int, int>
#define all(a) a.begin(), a.end()
#define mod 1000000007ll
#define ma 300005
ll a[ma], a1[ma];

void process() {
	int n;
	cin >> n;
	rep(i, 1, n) cin >> a[i];
	ll sum = 0;
	rep(i, 1, n) sum += a[i];
	if (sum%n) {
		cout << -1 << endl;
		return;
	}
	sum /= n;

	int ans = 0;
	rep(i, 1, n) a1[i] = a[i];

	vector <ii> b;
	rep(i, 2, n) {
		b.push_back(ii(a[i], i));
	}
	sort(all(b));

	repr(tmpp, b.size() - 1, 0) {
		int i = b[tmpp].second;
		if (a1[i] > sum) {
			ans++;
			a1[1] += (a1[i] / i)*i;
			a1[i] -= (a1[i] / i)*i;
		}
	}
	repr(tmpp, b.size() - 1, 0) {
		int i = b[tmpp].second;
		if (a1[i] > sum) {
			ans += 2;
			a1[1] -= i - a1[i];
			a1[i] = i;
			a1[1] += a1[i];
			a1[i] = 0;
		}
	}
	repr(tmpp, b.size() - 1, 0) {
		int i = b[tmpp].second;
		if (a1[i] < sum) {
			ans++;
		}
	}
	cout << ans << endl;

	repr(tmpp, b.size() - 1, 0) {
		int i = b[tmpp].second;
		if (a[i] > sum) {
			cout << i << " 1 " << (a[i] / i) << endl;
			a[1] += (a[i] / i)*i;
			a[i] -= (a[i] / i)*i;
		}
	}
	repr(tmpp, b.size() - 1, 0) {
		int i = b[tmpp].second;
		if (a[i] > sum) {
			cout << "1 " << i << ' ' << i - a[i] << endl;
			a[1] -= i - a[i];
			a[i] = i;
			cout << i << " 1 " << 1 << endl;
			a[1] += a[i];
			a[i] = 0;
		}
	}
	repr(tmpp, b.size() - 1, 0) {
		int i = b[tmpp].second;
		if (a[i] < sum) {
			cout << i << " 1 " << sum - a[i] << endl;
		}
	}
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
	//freopen("Test.inp", "r", stdin);
	//freopen("Test.out", "w", stdout);
	int t;
	cin >> t;
	while (t--) {
		process();
	}
	//process();
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <climits>
#include <queue>
#include <cstring>
#include <stack>
#include <ctime>
using namespace std;
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define repr(i,a,b) for(int i=a; i>=b; i--)
#define fi first
#define se second
#define ll long long int
#define endl "\n"
#define pb push_back
#define ii pair <int, int>
#define all(a) a.begin(), a.end()
#define mod 1000000007ll
#define ma 300005
ll a[ma], a1[ma];

void process() {
	int n;
	cin >> n;
	rep(i, 1, n) cin >> a[i];
	ll sum = 0;
	rep(i, 1, n) sum += a[i];
	if (sum%n) {
		cout << -1 << endl;
		return;
	}
	sum /= n;

	int ans = 0;
	rep(i, 1, n) a1[i] = a[i];

	vector <ii> b;
	rep(i, 2, n) {
		b.push_back(ii(a[i], i));
	}
	sort(all(b));

	repr(tmpp, b.size() - 1, 0) {
		int i = b[tmpp].second;
		if (a1[i] > sum) {
			ans++;
			a1[1] += (a1[i] / i)*i;
			a1[i] -= (a1[i] / i)*i;
		}
	}
	repr(tmpp, b.size() - 1, 0) {
		int i = b[tmpp].second;
		if (a1[i] > sum) {
			ans += 2;
			a1[1] -= i - a1[i];
			a1[i] = i;
			a1[1] += a1[i];
			a1[i] = 0;
		}
	}
	repr(tmpp, b.size() - 1, 0) {
		int i = b[tmpp].second;
		if (a1[i] < sum) {
			ans++;
		}
	}
	cout << ans << endl;

	repr(tmpp, b.size() - 1, 0) {
		int i = b[tmpp].second;
		if (a[i] > sum) {
			cout << i << " 1 " << (a[i] / i) << endl;
			a[1] += (a[i] / i)*i;
			a[i] -= (a[i] / i)*i;
		}
	}
	repr(tmpp, b.size() - 1, 0) {
		int i = b[tmpp].second;
		if (a[i] > sum) {
			cout << "1 " << i << ' ' << i - a[i] << endl;
			a[1] -= i - a[i];
			a[i] = i;
			cout << i << " 1 " << 1 << endl;
			a[1] += a[i];
			a[i] = 0;
		}
	}
	repr(tmpp, b.size() - 1, 0) {
		int i = b[tmpp].second;
		if (a[i] < sum) {
			cout << "1 " << i << ' ' << sum - a[i] << endl;
		}
	}
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
	//freopen("Test.inp", "r", stdin);
	//freopen("Test.out", "w", stdout);
	int t;
	cin >> t;
	while (t--) {
		process();
	}
	//process();
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <climits>
#include <queue>
#include <cstring>
#include <stack>
#include <ctime>
using namespace std;
#define rep(i,a,b) for(int i=a; i<=b; i++)
#define repr(i,a,b) for(int i=a; i>=b; i--)
#define fi first
#define se second
#define ll long long int
#define endl "\n"
#define pb push_back
#define ii pair <int, int>
#define all(a) a.begin(), a.end()
#define mod 1000000007ll
#define ma 300005
ll a[ma];

void process() {
	int n;
	cin >> n;
	rep(i, 1, n) cin >> a[i];
	ll sum = 0;
	rep(i, 1, n) sum += a[i];
	if (sum%n) {
		cout << -1 << endl;
		return;
	}
	sum /= n;
	cout << 3 * (n - 1) << endl;
	rep(i, 2, n) {
		cout << i << " 1 " << (a[i] / i) << endl;
		a[1] += (a[i] / i)*i;
		a[i] -= (a[i] / i)*i;
	}
	rep(i, 2, n) {
		cout << "1 " << i << ' ' << i - a[i] << endl;
		a[1] -= i - a[i];
		a[i] = i;
	}
	rep(i, 2, n) {
		cout << i << " 1 1" << endl;
		//a[1] += (a[i] / i)*i;
	}
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
	//freopen("Test.inp", "r", stdin);
	//freopen("Test.out", "w", stdout);
	int t;
	cin >> t;
	while (t--) {
		process();
	}
	//process();
	return 0;
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class DiverseGarland {

	private final static char[] COLORS = new char[]{'R', 'G', 'B'};

	private BufferedReader br;

	public static void main(String[] args) throws NumberFormatException, IOException {
		DiverseGarland be = new DiverseGarland();

		be.initAndRun(System.in);
	}

	public long initAndRun(InputStream in) throws NumberFormatException, IOException {
		init(in);
		int n = readInt();
		String s = br.readLine();

		long max = solve(n, s);

		return max;
	}

	private long solve(int n, String s) {

		int changes = 0;

		char[] charArray = s.toCharArray();
		StringBuffer sb = new StringBuffer();
		sb.append(charArray[0]);
		for (int i = 1; i < charArray.length; i++) {
			if(charArray[i] == charArray[i-1]) {
				changes++;
				if(i == charArray.length - 1 || charArray[i] == charArray[i+1]) {
					sb.append(next(charArray[i]));
					i ++;
					if(i < charArray.length - 1) sb.append(charArray[i]);
				} else {
					sb.append(resolve(charArray[i], charArray[i + 1]));
					i ++;
				}
			} else {
				sb.append(charArray[i]);
			}
		}
		System.out.println(changes);
		System.out.println(sb);
		return changes;
	}

	private String resolve(char c, char d) {
		int c1 = 0;
		while(c != COLORS[c1]) c1 ++;
		int d1 = 0;
		while(d != COLORS[d1]) d1 ++;

		String ret = COLORS[3 - c1 - d1] + "" + d;
		return ret;

	}

	private char next(char c) {
		int c1 = 0;
		while(c != COLORS[c1]) c1 ++;
		return COLORS[(c1 + 1) % 3];
	}

	private int readInt() throws NumberFormatException, IOException {
		return Integer.parseInt(br.readLine());
	}

	private void init(InputStream in) {
		this.br = new BufferedReader(new InputStreamReader(in));
	}
}


import java.util.*;
import java.math.*;
import java.io.*;

public class practice {
    public static void merge(int arr[], int l, int m, int r) {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        int L[] = new int[n1];
        int R[] = new int[n2];

        /*Copy data to temp arrays*/
        for (int i = 0; i < n1; ++i)
            L[i] = arr[l + i];
        for (int j = 0; j < n2; ++j)
            R[j] = arr[m + 1 + j];

        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2) {
            if (L[i] <= R[j]) {
                arr[k] = L[i];
                i++;
            } else {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1) {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2) {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    // Main function that sorts arr[l..r] using
    // merge()
    public static void sort(int arr[], int l, int r) {
        if (l < r) {
            // Find the middle point
            int m = (l + r) / 2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr, m + 1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }

    public static int isSubstring(String s1, String s2) {
        int M = s1.length();
        int N = s2.length();

        /* A loop to slide pat[] one by one */
        for (int i = 0; i <= N - M; i++) {
            int j;

            /* For current index i, check for
            pattern match */
            for (j = 0; j < M; j++)
                if (s2.charAt(i + j) != s1.charAt(j))
                    break;

            if (j == M)
                return i;
        }

        return -1;
    }

    public static int ans = (int) 1e9;
    public static String s1 = "";
    public static String s = "";
    public static int n;

    public static void sol(String x) {
        int res = 0;
        char z[] = s.toCharArray();
        for (int i = 0; i < n; ++i) {
            int y = i % 3;
            if (z[i] != x.charAt(y)) ++res;
            z[i] = x.charAt(y);
        }
        if (res < ans) {
            ans = res;
            s1 = new String(z);
        }
    }

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        n = Integer.parseInt(br.readLine());
        s = br.readLine();
        if (n == 1) {
            System.out.println(0);
            System.out.println(s);
        } else {
            char z[] = s.toCharArray();
            int count = 0;
            for (int i = 0; i < n - 2; i++) {
                if (z[i] == z[i + 1]) {
                    if (z[i] == 'R' && z[i + 2] == 'R') {
                        z[i + 1] = 'G';
                    } else if (z[i] == 'R' && z[i + 2] == 'B') {
                        z[i + 1] = 'G';
                    } else if (z[i] == 'R' && z[i + 2] == 'G') {
                        z[i + 1] = 'B';
                    } else if (z[i] == 'B' && z[i + 2] == 'B') {
                        z[i + 1] = 'G';
                    } else if (z[i] == 'B' && z[i + 2] == 'R') {
                        z[i + 1] = 'G';
                    } else if (z[i] == 'B' && z[i + 2] == 'G') {
                        z[i + 1] = 'R';
                    } else if (z[i] == 'G' && z[i + 2] == 'B') {
                        z[i + 1] = 'R';
                    } else if (z[i] == 'G' && z[i + 2] == 'R') {
                        z[i + 1] = 'B';
                    } else if (z[i] == 'G' && z[i + 2] == 'G') {
                        z[i + 1] = 'B';
                    }
                    count++;
                }
            }
            if (z[n - 2] == z[n - 1]) {
                if (z[n - 2] == 'R') z[n - 1] = 'G';
                else if (z[n - 2] == 'B') z[n - 1] = 'G';
                else if (z[n - 2] == 'G') z[n - 1] = 'B';
                count++;
            }
            System.out.println(count);
            System.out.println(new String(z));
        }
    }
}


import java.io.*;
import java.util.*;
/**
  * Built using my Brain
  * Actual solution is at the bottom
  *
  * @author Lenard Hoffstader
*/

public class cfjava
{
  public static void main(String[] args)
  {
    OutputStream outputStream = System.out;
    FastReader in = new FastReader();
    PrintWriter out = new PrintWriter(outputStream);
    PROBLEM solver = new PROBLEM();
    int t=1;
    // t=in.nextInt();
    for(int i=0;i<t;i++){
      solver.solve(in, out);
    }
    out.close();
  }

  static class PROBLEM
  {
    public void solve(FastReader in,PrintWriter out)
    {
      int n = in.nextInt();
      char arr[]=in.nextLine().toCharArray();
      HashMap<Character,Character> mp = new HashMap<>();
      mp.put('R','G');
      mp.put('G','B');
      mp.put('B','R');
      char ch=arr[0];
      int ans=0,curr=1;
      int j=0;
      for(int i=1;i<n;i++){
        if(ch==arr[i]){curr++;}
        else {
          if(curr%2!=0){
            for(int k=j;k<i;k++){
              if((k-j)%2==1){ans++;arr[k]=mp.get(arr[k]);}
            }
          }
          else {
            char ch1 = mp.get(arr[j]);
            if(ch1==arr[i]){ch1=mp.get(ch1);}
            for(int k=j;k<i;k++){
              if((k-j)%2==1){ans++;arr[k]=ch1;}
            }
          }
          ch=arr[i];
          j=i;
          curr=1;
        }
      }
      if(curr%2==1){
        for(int k=j;k<n;k++){
          if((k-j)%2==1){ans++;arr[k]=mp.get(arr[k]);}
        }
      }
      else {
        for(int k=j;k<n;k++){
          if((k-j)%2==1){ans++;arr[k]=mp.get(arr[k]);}
        }
      }
      out.println(ans);
      for(char x:arr)out.print(x);
    }
  }

  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());}

    boolean nextBoolean(){return !(nextInt()==0);}
    // boolean nextBoolean(){return Boolean.parseBoolean(next());}

    String nextLine()
    {
      String str = "";
      try
      {
        str = br.readLine();
      }
      catch (IOException e){e.printStackTrace();}
      return str;
    }
  }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;

import java.util.*;

public class Main {

    static boolean[][]vis;
    static int x,y,m;
    static int ans=Integer.MAX_VALUE;
    static char[][]a;
    static int dx[]={1,-1,0,0};
    static int []dy={0,0,1,-1};
    static void dfs(int r,int c,int sum){
        if (r<0||r>=m||c<0||c>=m||vis[r][c])return;
        if (a[r][c]=='3'){
            ans=Math.min(ans,sum);
            return;
        }
        vis[r][c]=true;
        for (int i = 0; i < 4; i++) {
            dfs(dx[i]+r,dy[i]+c,sum+1);
        }
    }

        public static void main (String[]args) throws IOException {
            Scanner in = new Scanner(System.in);

            try (PrintWriter or = new PrintWriter(System.out)) {
                int n=in.nextInt();
                char[]a=in.next().toCharArray();
                int ans=0;
                for (int i = 0; i < n-1; i++) {
                    if (a[i]==a[i+1]){
                        ++ans;
                        if (a[i]=='R'){
                            //R
                            if (i+2<n){
                                if (a[i+2]=='G')a[i+1]='B';
                                else if (a[i+2]=='B')a[i+1]='G';
                                else a[i+1]='B';
                            }else a[i+1]='G';
                        }else if (a[i]=='B'){
                            if (i+2<n){
                                if (a[i+2]=='G')a[i+1]='R';
                                else if (a[i+2]=='R')a[i+1]='G';
                                else a[i+1]='R';
                            }else a[i+1]='G';
                        }else{
                            //G
                            if (i+2<n){
                                if (a[i+1]=='B')a[i+1]='R';
                                else if (a[i+1]=='R')a[i+1]='B';
                                else {
                                    a[i+1]='B';
                                }
                            }else a[i+1]='B';
                        }
                    }
                }
                or.println(ans);
                or.println(new String(a));

            }
        }

    static long gcd(long a, long b)
    {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }
    static int getlen(int r,int l,int a){
        return (r-l+1+1)/(a+1);
    }

    static class Scanner {

        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

    }
}

class Pair  {
    int first, second,third;

    public Pair(int first, int second) {
        this.first = first;
        this.second = second;
    }

    public Pair(int first, int second, int third) {
        this.first = first;
        this.second = second;
        this.third = third;
    }
}

class Tempo {

    String first;
    int second;

    public Tempo(String first, int second) {
        this.first = first;
        this.second = second;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;

import java.util.*;

public class Main {

    static boolean[][]vis;
    static int x,y,m;
    static int ans=Integer.MAX_VALUE;
    static char[][]a;
    static int dx[]={1,-1,0,0};
    static int []dy={0,0,1,-1};
    static void dfs(int r,int c,int sum){
        if (r<0||r>=m||c<0||c>=m||vis[r][c])return;
        if (a[r][c]=='3'){
            ans=Math.min(ans,sum);
            return;
        }
        vis[r][c]=true;
        for (int i = 0; i < 4; i++) {
            dfs(dx[i]+r,dy[i]+c,sum+1);
        }
    }

        public static void main (String[]args) throws IOException {
            Scanner in = new Scanner(System.in);

            try (PrintWriter or = new PrintWriter(System.out)) {
                int n=in.nextInt();
                char[]a=in.next().toCharArray();
                int ans=0;
                for (int i = 0; i < n-1; i++) {
                    if (a[i]==a[i+1]){
                        ++ans;
                        if (a[i]=='R'){
                            if (i+2<n){
                                int idx=i+2;
                                if (a[idx]=='G')a[i+1]='B';
                                else if (a[idx]=='B')a[i+1]='G';
                                else a[i+1]='G';
                            }else a[i+1]='G';
                        }
                        else if (a[i]=='G'){
                            if (i+2<n){
                                int idx=i+2;
                                if (a[idx]=='R')a[i+1]='B';
                                else if (a[idx]=='B')a[i+1]='R';
                                else a[i+1]='R';
                            }else a[i+1]='B';

                        }else{
                            //B
                            if (i+2<n){
                                int idx=i+2;
                                if (a[idx]=='R')a[i+1]='G';
                                else if (a[idx]=='G')a[i+1]='R';
                                else a[i+1]='R';
                            }else a[i+1]='R';
                        }
                    }
                }
                or.println(ans);
                or.println(new String(a));

            }
        }

    static long gcd(long a, long b)
    {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }
    static int getlen(int r,int l,int a){
        return (r-l+1+1)/(a+1);
    }

    static class Scanner {

        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

    }
}

class Pair  {
    int first, second,third;

    public Pair(int first, int second) {
        this.first = first;
        this.second = second;
    }

    public Pair(int first, int second, int third) {
        this.first = first;
        this.second = second;
        this.third = third;
    }
}

class Tempo {

    String first;
    int second;

    public Tempo(String first, int second) {
        this.first = first;
        this.second = second;
    }
}


import java.util.*;
import java.io.*;

public class Solution{

     public static void main(String []args){
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        String s = sc.next();
        char[] ch = s.toCharArray();

        int total = 'R' + 'G' + 'B';

        long res = 0;

        for(int i =  1 ; i < n ; i++){

            char curr = ch[i];
            char prev = ch[i - 1];

            if(curr == prev){

                res++;
                char next = i == n - 1 ?'X': ch[i+1];

                if(curr == next || next =='X'){
                    if(prev == 'R'){
                        ch[i] = 'G';
                    }

                    else if(prev == 'G'){
                        ch[i] = 'B';
                    }
                    else{
                        ch[i] = 'R';
                    }

                }
                else{
                    ch[i] = (char)(total - (prev + next));
                }

            }

        }
        System.out.println(res);

        System.out.println(new String(ch));

     }
}


import java.io.*;
import java.util.*;

public class Main {
	static ArrayList<Integer> adj[];

	static int k;
	static int[] a;
	static int b[];
	static int m;

	static class Pair implements Comparable<Pair> {
		long a;
		long b;
		public Pair(long c, long l) {
			a = c;
			b = l;
		}
		@Override
		public int compareTo(Pair o) {
		if(o.a-o.b>this.a-this.b)
			return 1;
		else if(o.a-o.b==this.a-this.b)
			return 0;
		else {
			return -1;
		}
	}
}

	static ArrayList<Pair> adjlist[];
	// static char c[];
	static long mod = (long) (1e9+7);
	static int V;
	static long INF = (long) 1E16;
	static int n;
	static char c[];
	static Pair p[];
static int grid[][];
static Scanner sc = new Scanner(System.in);
static PrintWriter out = new PrintWriter(System.out);
public static void main(String args[]) throws Exception {
	int n=sc.nextInt();
	String s=sc.nextLine();
	char c[]=s.toCharArray();
	int count=0;
	for (int i = 1; i < c.length; i++) {
		if(c[i]==c[i-1]&&c[i]=='B') {
			if(i+1<n&&c[i+1]=='B') {
				c[i]='R';
			}
			else if(i+1<n&&c[i+1]=='G') {
				c[i]='R';
			}
			else if(i+1<n&&c[i+1]=='R') {
				c[i]='G';
			}
			else {
				c[i]='R';
			}
			count++;
		}
		else if(c[i]==c[i-1]&&c[i]=='R') {
			if(i+1<n&&c[i+1]=='R') {
				c[i]='B';
			}
			else if(i+1<n&&c[i+1]=='G') {
				c[i]='B';
			}
			else if(i+1<n&&c[i+1]=='B') {
				c[i]='G';
			}
			else {
				c[i]='B';
			}
			count++;

		}
		else if(c[i]==c[i-1]&&c[i]=='G') {
			if(i+1<n&&c[i+1]=='B') {
				c[i]='R';
			}
			else if(i+1<n&&c[i+1]=='G') {
				c[i]='R';
			}
			else if(i+1<n&&c[i+1]=='R') {
				c[i]='B';
			}
			else {
				c[i]='R';
			}
			count++;

		}
	}
	out.println(count);
	for(char ss:c) {
		out.print(ss);
	}

	out.flush();
}

static void dfs(int u) {
	vis[u]=true;
	for(int v:adj[u]) {
		if(!vis[v]) {
			dfs(v);
		}
	}
}
static void update(int idx,int val) {
	if(idx==0) {
		total-=a[0];
		if(idx+1<a.length)
		total-=Math.max(0,a[idx+1]-a[idx]);
		a[0]=val;
		total+=a[0];
		if(idx+1<a.length)
		total+=Math.max(0,a[idx+1]-a[idx]);

		return;
	}
	if(idx>0) {
		total-=Math.max(0,a[idx]-a[idx-1]);
	}
	 if(idx+1<a.length) {
		total-=Math.max(0,a[idx+1]-a[idx]);
	}
	a[idx]=val;
	 if(idx>0) {
		total+=Math.max(0,a[idx]-a[idx-1]);
	}
	 if(idx+1<a.length) {
		total+=Math.max(0,a[idx+1]-a[idx]);
	}
}
static int[] compreessarray(int c[]) {
	Stack<Integer> st=new Stack<>();
	for (int i = 0; i < c.length; i++) {
		if(st.isEmpty()||c[i]!=st.peek())
		st.add(c[i]);
	}
	b=new int[st.size()];
	for (int i = b.length-1; i>=0; i--) {
		b[i]=st.pop();
	}
	return b;
}
static int div4[];
static long [] reversearray(long a[]) {
	for (int i = 0; i <a.length/2; i++) {
		long temp=a[i];
		a[i]=a[a.length-i-1];
		a[a.length-i-1]=temp;
	}
	return a;
}
static int [] reversearray(int a[]) {
	for (int i = 0; i <=a.length/2; i++) {
		int temp=a[i];
		a[i]=a[a.length-i-1];
		a[a.length-i-1]=temp;
	}
	return a;
}
static class SegmentTree {		// 1-based DS, OOP

	int N; 			//the number of elements in the array as a power of 2 (i.e. after padding)
	int[] array, sTree, lazy;

	SegmentTree(int[] in)
	{
		array = in; N = in.length - 1;
		sTree = new int[N<<1];		//no. of nodes = 2*N - 1, we add one to cross out index zero
		lazy = new int[N<<1];
		build(1,1,N);
	}

	void build(int node, int b, int e)	// O(n)
	{
		if(b == e)
			sTree[node] = array[b];
		else
		{
			int mid = b + e >> 1;
			build(node<<1,b,mid);
			build(node<<1|1,mid+1,e);
			sTree[node] = sTree[node<<1]+sTree[node<<1|1];
		}
	}

	void update_point(int index, int val)			// O(log n)
	{
		index += N - 1;
		sTree[index] += val;
		while(index>1)
		{
			index >>= 1;
			sTree[index] = sTree[index<<1] + sTree[index<<1|1];
		}
	}

	void update_range(int i, int j, int val)		// O(log n)
	{
		update_range(1,1,N,i,j,val);
	}

	void update_range(int node, int b, int e, int i, int j, int val)
	{
		if(i > e || j < b)
			return;
		if(b >= i && e <= j)
		{
			sTree[node] += (e-b+1)*val;
			lazy[node] += val;
		}
		else
		{
			int mid = b + e >> 1;
			propagate(node, b, mid, e);
			update_range(node<<1,b,mid,i,j,val);
			update_range(node<<1|1,mid+1,e,i,j,val);
			sTree[node] = sTree[node<<1] + sTree[node<<1|1];
		}

	}
	void propagate(int node, int b, int mid, int e)
	{
		lazy[node<<1] += lazy[node];
		lazy[node<<1|1] += lazy[node];
		sTree[node<<1] += (mid-b+1)*lazy[node];
		sTree[node<<1|1] += (e-mid)*lazy[node];
		lazy[node] = 0;
	}

	int query(int i, int j)
	{
		return query(1,1,N,i,j);
	}

	int query(int node, int b, int e, int i, int j)	// O(log n)
	{
		if(i>e || j <b)
			return 0;
		if(b>= i && e <= j)
			return sTree[node];
		int mid = b + e >> 1;
		propagate(node, b, mid, e);
		int q1 = query(node<<1,b,mid,i,j);
		int q2 = query(node<<1|1,mid+1,e,i,j);
		return q1 + q2;

	}
}
static  TreeSet<Integer> ts=new TreeSet();
static HashMap<Integer, Integer> compress(int a[]) {
		 ts = new TreeSet<>();
		HashMap<Integer, Integer> hm = new HashMap<>();
		for (int x : a)
			ts.add(x);
		for (int x : ts) {
			hm.put(x, hm.size() + 1);
		}
		return hm;
	}

	static  class FenwickTree { // one-based DS

		int n;
		int[] ft;

		FenwickTree(int size) { n = size; ft = new int[n+1]; }

		int rsq(int b) //O(log n)
		{
			int sum = 0;
			while(b > 0) { sum += ft[b]; b -= b & -b;}		//min?
			return sum;
		}

		int rsq(int a, int b) { return rsq(b) - rsq(a-1); }

		void point_update(int k, int val)	//O(log n), update = increment
		{
			while(k <= n) { ft[k] += val; k += k & -k; }		//min?
		}
	}
	static ArrayList<Integer> euler=new ArrayList<>();

	static ArrayList<Integer> arr;

static long total;
static TreeMap<Integer,Integer> map1;

		static int zz;
//static int dp(int idx,int left,int state) {
//if(idx>=k-((zz-left)*2)||idx+1==n) {
//	return 0;
//}
//if(memo[idx][left][state]!=-1) {
//	return memo[idx][left][state];
//}
//int ans=a[idx+1]+dp(idx+1,left,0);
//if(left>0&&state==0&&idx>0) {
//	ans=Math.max(ans,a[idx-1]+dp(idx-1,left-1,1));
//}
//return memo[idx][left][state]=ans;
//}21
static HashMap<Integer,Integer> map;
static int maxa=0;
static int ff=123123;

static int[][] memo;

	static long modmod=998244353;
	static int dx[]= {1,-1,0,0};
	 static int dy[]= {0,0,1,-1};
	static class BBOOK implements Comparable<BBOOK>{
		int t;
		int alice;
		int bob;
		public BBOOK(int x,int y,int z) {
		t=x;
		alice=y;
		bob=z;
		}
		@Override
		public int compareTo(BBOOK o) {
			return this.t-o.t;
		}
	}
	private static long lcm(long a2, long b2) {
	return (a2*b2)/gcd(a2,b2);
	}
	static class Edge implements Comparable<Edge>
	{
		int node;long cost ; long time;

		Edge(int a, long b,long c) { node = a;	cost = b; time=c; }

		public int compareTo(Edge e){ return Long.compare(time,e.time);	}
	}

        static void sieve(int N)	// O(N log log N)
	{
		isComposite = new int[N+1];
		isComposite[0] = isComposite[1] = 1;			// 0 indicates a prime number
		primes = new ArrayList<Integer>();

		for (int i = 2; i <= N; ++i) 					//can loop till i*i <= N if primes array is not needed O(N log log sqrt(N))
			if (isComposite[i] == 0) 					//can loop in 2 and odd integers for slightly better performance
			{
				primes.add(i);
				if(1l * i * i <= N)
					for (int j = i * i; j <= N; j += i)	// j = i * 2 will not affect performance too much, may alter in modified sieve
						isComposite[j] = 1;
			}
	}
    static TreeSet<Integer> factors;
    static TreeSet<Integer> primeFactors(int N)		// O(sqrt(N) / ln sqrt(N))
	{
		 factors = new TreeSet<Integer>();		//take abs(N) in case of -ve integers
		int idx = 0, p = primes.get(idx);

		while(1l*p * p <= N)
		{
			while(N % p == 0) { factors.add(p); N /= p; }
			p = primes.get(++idx);
		}

		if(N != 1)						// last prime factor may be > sqrt(N)
			factors.add(N);				// for integers whose largest prime factor has a power of 1
		return factors;
	}

	static class UnionFind {
		int[] p, rank, setSize;
		int numSets;
		int max[];

		public UnionFind(int N) {
			p = new int[numSets = N];
			rank = new int[N];
			setSize = new int[N];
			for (int i = 0; i < N; i++) {
				p[i] = i;
				setSize[i] = 1;
			}
		}

		public int findSet(int i) {
			return p[i] == i ? i : (p[i] = findSet(p[i]));
		}

		public boolean isSameSet(int i, int j) {
			return findSet(i) == findSet(j);
		}
		public int chunion(int i,int j, int x2) {
			if (isSameSet(i, j))
				return 0;
			numSets--;
			int x = findSet(i), y = findSet(j);
			int z=findSet(x2);
			p[x]=z;;
			p[y]=z;
		return x;
		}

		public void unionSet(int i, int j) {
			if (isSameSet(i, j))
				return;
			numSets--;
			int x = findSet(i), y = findSet(j);
			if (rank[x] > rank[y]) {
				p[y] = x;
				setSize[x] += setSize[y];

			} else {
				p[x] = y;
				setSize[y] += setSize[x];
				if (rank[x] == rank[y])
					rank[y]++;

			}
		}

		public int numDisjointSets() {
			return numSets;
		}

		public int sizeOfSet(int i) {
			return setSize[findSet(i)];
		}
	}

	static class Quad implements Comparable<Quad> {
		int u;
		int v;
		char state;
		int turns;

		public Quad(int i, int j, char c, int k) {
			u = i;
			v = j;
			state = c;
			turns = k;
		}

		public int compareTo(Quad e) {
			return (int) (turns - e.turns);
		}

	}

	static long manhatandistance(long x, long x2, long y, long y2) {
		return Math.abs(x - x2) + Math.abs(y - y2);
	}

	static long fib[];

	static long fib(int n) {
		if (n == 1 || n == 0) {
			return 1;
		}
		if (fib[n] != -1) {
			return fib[n];
		} else
			return fib[n] = ((fib(n - 2) % mod + fib(n - 1) % mod) % mod);
	}

	static class Point  implements Comparable<Point>{
		long x, y;

		Point(long counth, long counts) {
			x = counth;
			y = counts;
		}

		@Override
		public int compareTo(Point p )
		{
			return Long.compare(p.y*1l*x, p.x*1l*y);
		}
	}

	static TreeSet<Long> primeFactors(long N) // O(sqrt(N) / ln sqrt(N))
	{
		TreeSet<Long> factors = new TreeSet<Long>(); // take abs(N) in case of -ve integers
		int idx = 0, p = primes.get(idx);

		while (p * p <= N) {
			while (N % p == 0) {
				factors.add((long) p);
				N /= p;
			}
			if (primes.size() > idx + 1)
				p = primes.get(++idx);
			else
				break;
		}

		if (N != 1) // last prime factor may be > sqrt(N)
			factors.add(N); // for integers whose largest prime factor has a power of 1
		return factors;
	}

	static boolean visited[];

	/**
	 * static int bfs(int s) { Queue<Integer> q = new LinkedList<Integer>();
	 * q.add(s); int count=0; int maxcost=0; int dist[]=new int[n]; dist[s]=0;
	 * while(!q.isEmpty()) {
	 *
	 * int u = q.remove(); if(dist[u]==k) { break; } for(Pair v: adj[u]) {
	 * maxcost=Math.max(maxcost, v.cost);
	 *
	 *
	 *
	 * if(!visited[v.v]) {
	 *
	 * visited[v.v]=true; q.add(v.v); dist[v.v]=dist[u]+1; maxcost=Math.max(maxcost,
	 * v.cost); } }
	 *
	 * } return maxcost; }
	 **/

	static boolean[] vis2;

	static boolean f2 = false;

	static long[][] matMul(long[][] a2, long[][] b, int p, int q, int r) // C(p x r) = A(p x q) x (q x r) -- O(p x q x
																			// r)
	{
		long[][] C = new long[p][r];
		for (int i = 0; i < p; ++i) {
			for (int j = 0; j < r; ++j) {
				for (int k = 0; k < q; ++k) {
					C[i][j] = (C[i][j] + (a2[i][k] % mod * b[k][j] % mod)) % mod;
					C[i][j] %= mod;
				}

			}
		}
		return C;
	}
	public static int[] schuffle(int[] a2) {
		for (int i = 0; i < a2.length; i++) {
			int x =  (int) (Math.random() * a2.length);
			int temp = a2[x];
			a2[x] = a2[i];
			a2[i] = temp;
		}
		return a2;
	}

	static boolean vis[];
	static HashSet<Integer> set = new HashSet<Integer>();

	static long modPow(long ways, long count, long mod) // O(log e)
	{
		ways %= mod;
		long res = 1;
		while (count > 0) {
			if ((count & 1) == 1)
				res = (res * ways) % mod;
			ways = (ways * ways) % mod;
			count >>= 1;
		}
		return res % mod;
	}

	static long gcd(long l, long o) {
		if (o == 0) {
			return l;
		}
		return gcd(o, l % o);
	}

	static int[] isComposite;
	static int[] valid;

	static ArrayList<Integer> primes;
	static ArrayList<Integer> l1;

	static TreeSet<Integer> primus = new TreeSet<Integer>();

	static void sieveLinear(int N)
	{
		int[] lp = new int[N + 1];								//lp[i] = least prime divisor of i
		for(int i = 2; i <= N; ++i)
		{
			if(lp[i] == 0)
			{
				primus.add(i);
				lp[i] = i;
			}
			int curLP = lp[i];
			for(int p: primus)
				if(p > curLP || p * i > N)
					break;
				else
					lp[p * i] = i;
		}
	}

	public static long[] schuffle(long[] a2) {
		for (int i = 0; i < a2.length; i++) {
			int x =  (int) (Math.random() * a2.length);
			long temp = a2[x];
			a2[x] = a2[i];
			a2[i] = temp;
		}
		return a2;
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}

		public int[] nxtArr(int n) throws IOException {
			int[] ans = new int[n];
			for (int i = 0; i < n; i++)
				ans[i] = nextInt();
			return ans;
		}

	}
	public static int[] sortarray(int a[]) {
		schuffle(a);
		Arrays.sort(a);
		return a;
		}
		public static long[] sortarray(long a[]) {
			schuffle(a);
			Arrays.sort(a);
			return a;
		}
		public static int[] readarray(int n) throws IOException {
			int a[]=new int[n];
			for (int i = 0; i < a.length; i++) {
			a[i]=sc.nextInt();
			}
			return a;
		}
		public static long[] readlarray(int n) throws IOException {
			long a[]=new long[n];
			for (int i = 0; i < a.length; i++) {
			a[i]=sc.nextLong();
			}
			return a;
		}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Jaynil
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            StringBuilder x = new StringBuilder(in.next());
            int map[] = new int[256];
            char rev[] = new char[10];
            map['R'] = 1;
            map['G'] = 2;
            map['B'] = 4;
            rev[1] = 'R';
            rev[2] = 'G';
            rev[4] = 'B';
            int ans = 0;
            for (int i = 1; i < n; i++) {
                if (x.charAt(i) == x.charAt(i - 1)) {
                    if (i != n - 1 && x.charAt(i) != x.charAt(i + 1)) {
                        x.setCharAt(i, rev[7 - map[x.charAt(i)] - map[x.charAt(i + 1)]]);
                    } else if (x.charAt(i) == 'R') {
                        x.setCharAt(i, 'G');
                    } else if (x.charAt(i) == 'G') {
                        x.setCharAt(i, 'B');
                    } else {
                        x.setCharAt(i, 'R');
                    }
                    ans++;
                }
            }
            out.println(ans);
            out.println(x.toString());
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


	import java.io.*;
	import java.util.*;
	import java.math.*;

	 public class Main	{
	   static class Pair implements Comparable<Pair>{
	   int a;
	   int b;
	   public Pair(){}
	   public Pair(int x,int y){a=x;b=y;}
	   public int compareTo(Pair p){
		 return Integer.compare(a, p.a);
	   }
//		   long a,b;
//		   public Pair(long x,long y){a=x;b=y;}
//		   public int compareTo(Pair p){
//				 return Long.compare(a, p.a);
//		   }
//
		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + a;
			result = prime * result + b;

			return result;
		}
		@Override
		public boolean equals(Object obj) {
			Pair cur = (Pair)obj;
			if((a==cur.a && b==cur.b))return true;
			return false;
		}
	 }
	   static class ArrayUtils {
		public static Integer[] generateOrder(int size) {
			Integer[] order = new Integer[size];
			for (int i = 0; i < size; i++)
				order[i] = i;
			return order;
		}

		public static Integer[] order(int size, Comparator<Integer> comparator) {
			Integer[] order = generateOrder(size);
			Arrays.sort(order, comparator);
			return order;
		}

			}
	   static class cell implements Comparable<cell>{
		   int a,b;
		   long dis;
		   public cell(int x,int y,long z) {a=x;b=y;dis=z;}
		   public int compareTo(cell c) {
			   return Long.compare(dis,c.dis);
		   }
	   }
	static class TrieNode{
		TrieNode left;
		TrieNode right;
		int op;
		int data;
		public TrieNode() {}
	}
	  public static int gcd(int a,int b)
	  {
	    if(a<b)
	      return gcd(b,a);
	    if(b==0)
	      return a;
	    return gcd(b,a%b);

	  }
	  static int lcm(int a,int b) {
		  return  a*b / gcd(a,b);
	  }
	  //static long ans = 0;
	  static long mod = (long)(1e9+7); //998244353;//

	    public static void main(String[] args) throws Exception {
	       new Thread(null, null, "Anshum Gupta", 99999999) {
	            public void run() {
	                try {
	                    solve();
	                } catch(Exception e) {
	                    e.printStackTrace();
	                    System.exit(1);
	                }
	            }
	        }.start();
	    }

	static long pow(long x,long y){
	    if(y == 0)return 1;
	    if(y==1)return x;
	    long a = pow(x,y/2);
	    a = (a*a)%mod;
	    if(y%2==0){
	        return a;
	    }
	    return (a*x)%mod;
	}

	static long mxx;
	static int mxN = (int)(2e6+5);
	static long[]fact,inv_fact;
	static long my_inv(long a) {
		return pow(a,mod-2);
	}
	static long bin(int a,int b) {
		if(a < b || a<0 || b<0)return 0;
	    return ((fact[a]*inv_fact[a-b])%mod * inv_fact[b])%mod;
	}
		static ArrayList<ArrayList<Integer>>adj;
		static boolean[]vis;
	static void make_facts() {
	  fact=new long[mxN];
	  inv_fact = new long[mxN];
	  fact[0]=inv_fact[0]=1L;
	  for(int i=1;i<mxN;i++) {
		   fact[i] = (i*fact[i-1])%mod;
		   inv_fact[i] = my_inv(fact[i]);
	  }
	}

	 public static void solve() throws Exception {
	   // solve the problem here
	   MyScanner s = new MyScanner();
	        out = new PrintWriter(new BufferedOutputStream(System.out), true);
	        int tc = 1;//s.nextInt();
	        mxx = (long)(1e18+5);
	//	        make_facts();
	//	        int mod = (int)1e9+7;
	        while(tc-->0){
	        	int n = s.nextInt();
	        	String str = s.next();
	        	char[]arr = {'R', 'G', 'B'};
	        	StringBuilder ans = new StringBuilder("");
	        	int cnt = 0;
	        	for(int i=0;i<n-1;i++) {

	        		if(str.charAt(i) == str.charAt(i+1)) {
	        			cnt++;
	        			if(i == n-2) {
	        				ans.append(str.charAt(i));
	        				ans.append(str.charAt(i) == 'R' ? 'G' : 'R');
	        			}
	        			else {
	        				ans.append(str.charAt(i));
	        				int j = 0;
	        				for(j=0;j<3;j++) {
	        					if(str.charAt(i) == arr[j]) {
	        						break;
	        					}
	        				}
	        				if(str.charAt(i) == str.charAt(i+2)) {
	        					ans.append(arr[(j+1)%3]);
	        					i++;
	        				}
	        				else {
	        					int k = 0;
	        					for(k=0;k<3;k++) {
	        						if(str.charAt(i+2) == arr[k]) {
	        							break;
	        						}
	        					}
	        					for(int l=0;l<3;l++) {
	        						if(l!=j && l!= k) {
	        							ans.append(arr[l]);
	        							i++;
	        							break;
	        						}
	        					}
	        				}
	        			}
	        		}
	        		else {
	        			ans.append(str.charAt(i));
	        		}
	        	}
	        	out.println(cnt);
	        	out.println(ans.toString());
	        }

	        out.flush();
	}

	    //-----------PrintWriter for faster output---------------------------------
	    public static PrintWriter out;

	    //-----------MyScanner class for faster input----------
	    public static class MyScanner {
	        BufferedReader br;
	        StringTokenizer st;

	        public MyScanner() {
	            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;
	        }
	    }
	    //--------------------------------------------------------
	}


	import java.io.*;
	import java.util.*;
	import java.math.*;

	 public class Main	{
	   static class Pair implements Comparable<Pair>{
	   int a;
	   int b;
	   public Pair(){}
	   public Pair(int x,int y){a=x;b=y;}
	   public int compareTo(Pair p){
		 return Integer.compare(a, p.a);
	   }
//		   long a,b;
//		   public Pair(long x,long y){a=x;b=y;}
//		   public int compareTo(Pair p){
//				 return Long.compare(a, p.a);
//		   }
//
		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + a;
			result = prime * result + b;

			return result;
		}
		@Override
		public boolean equals(Object obj) {
			Pair cur = (Pair)obj;
			if((a==cur.a && b==cur.b))return true;
			return false;
		}
	 }
	   static class ArrayUtils {
		public static Integer[] generateOrder(int size) {
			Integer[] order = new Integer[size];
			for (int i = 0; i < size; i++)
				order[i] = i;
			return order;
		}

		public static Integer[] order(int size, Comparator<Integer> comparator) {
			Integer[] order = generateOrder(size);
			Arrays.sort(order, comparator);
			return order;
		}

			}
	   static class cell implements Comparable<cell>{
		   int a,b;
		   long dis;
		   public cell(int x,int y,long z) {a=x;b=y;dis=z;}
		   public int compareTo(cell c) {
			   return Long.compare(dis,c.dis);
		   }
	   }
	static class TrieNode{
		TrieNode left;
		TrieNode right;
		int op;
		int data;
		public TrieNode() {}
	}
	  public static int gcd(int a,int b)
	  {
	    if(a<b)
	      return gcd(b,a);
	    if(b==0)
	      return a;
	    return gcd(b,a%b);

	  }
	  static int lcm(int a,int b) {
		  return  a*b / gcd(a,b);
	  }
	  //static long ans = 0;
	  static long mod = (long)(1e9+7); //998244353;//

	    public static void main(String[] args) throws Exception {
	       new Thread(null, null, "Anshum Gupta", 99999999) {
	            public void run() {
	                try {
	                    solve();
	                } catch(Exception e) {
	                    e.printStackTrace();
	                    System.exit(1);
	                }
	            }
	        }.start();
	    }

	static long pow(long x,long y){
	    if(y == 0)return 1;
	    if(y==1)return x;
	    long a = pow(x,y/2);
	    a = (a*a)%mod;
	    if(y%2==0){
	        return a;
	    }
	    return (a*x)%mod;
	}

	static long mxx;
	static int mxN = (int)(2e6+5);
	static long[]fact,inv_fact;
	static long my_inv(long a) {
		return pow(a,mod-2);
	}
	static long bin(int a,int b) {
		if(a < b || a<0 || b<0)return 0;
	    return ((fact[a]*inv_fact[a-b])%mod * inv_fact[b])%mod;
	}
		static ArrayList<ArrayList<Integer>>adj;
		static boolean[]vis;
	static void make_facts() {
	  fact=new long[mxN];
	  inv_fact = new long[mxN];
	  fact[0]=inv_fact[0]=1L;
	  for(int i=1;i<mxN;i++) {
		   fact[i] = (i*fact[i-1])%mod;
		   inv_fact[i] = my_inv(fact[i]);
	  }
	}

	 public static void solve() throws Exception {
	   // solve the problem here
	   MyScanner s = new MyScanner();
	        out = new PrintWriter(new BufferedOutputStream(System.out), true);
	        int tc = 1;//s.nextInt();
	        mxx = (long)(1e18+5);
	//	        make_facts();
	//	        int mod = (int)1e9+7;
	        while(tc-->0){
	        	int n = s.nextInt();
	        	String str = s.next();
	        	char[]arr = {'R', 'G', 'B'};
	        	StringBuilder ans = new StringBuilder("");
	        	int cnt = 0;
	        	int i = 0;
	        	for(i=0;i<n-1;i++) {

	        		if(str.charAt(i) == str.charAt(i+1)) {
	        			cnt++;
	        			if(i == n-2) {
	        				ans.append(str.charAt(i));
	        				ans.append(str.charAt(i) == 'R' ? 'G' : 'R');
	        			}
	        			else {
	        				ans.append(str.charAt(i));
	        				int j = 0;
	        				for(j=0;j<3;j++) {
	        					if(str.charAt(i) == arr[j]) {
	        						break;
	        					}
	        				}
	        				if(str.charAt(i) == str.charAt(i+2)) {
	        					ans.append(arr[(j+1)%3]);
	        					i++;
	        				}
	        				else {
	        					int k = 0;
	        					for(k=0;k<3;k++) {
	        						if(str.charAt(i+2) == arr[k]) {
	        							break;
	        						}
	        					}
	        					for(int l=0;l<3;l++) {
	        						if(l!=j && l!= k) {
	        							ans.append(arr[l]);
	        							i++;
	        							break;
	        						}
	        					}
	        				}
	        			}
	        		}
	        		else {
	        			ans.append(str.charAt(i));
//	        			if(i == n-2) {
//	        				ans.append(str.charAt(i+1));
//	        			}
	        		}
	        	}
	        	if(ans.length() == n-1) {
	        		ans.append(str.charAt(n-1));
	        	}
	        	out.println(cnt);
	        	out.println(ans.toString());
	        }

	        out.flush();
	}

	    //-----------PrintWriter for faster output---------------------------------
	    public static PrintWriter out;

	    //-----------MyScanner class for faster input----------
	    public static class MyScanner {
	        BufferedReader br;
	        StringTokenizer st;

	        public MyScanner() {
	            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;
	        }
	    }
	    //--------------------------------------------------------
	}


// package cp;
import java.io.*;
import java.math.*;
import java.util.*;
public class Cf_three {
	long gcd(long a,long b) {if(b==0)return a;else return gcd(b,a%b);}
	void swap(long a,long b) {long temp=a;a=b;b=temp;}
	public static void main(String[] args) throws IOException {
		PrintWriter out = new PrintWriter(System.out);
		Readers.init(System.in);
		Cf_three obj=new Cf_three();
		int n=Readers.nextInt();
		String s=Readers.next();
		char[] temp=s.toCharArray();
		int cnt=0;
		for (int i = 1; i <n; i++) {
			if(temp[i]==temp[i-1]) {
				if(i==n-1) {
					if(temp[i-1]=='R')temp[i]='G';
					if(temp[i-1]=='G')temp[i]='R';
					if(temp[i-1]=='B')temp[i]='R';
				}
				else {
					if(temp[i-1]=='R') {
						if(temp[i+1]=='R')temp[i]='G';
						if(temp[i+1]=='G')temp[i]='B';
						if(temp[i+1]=='B')temp[i]='G';
					}
					if(temp[i-1]=='G') {
						if(temp[i+1]=='G')temp[i]='R';
						if(temp[i+1]=='R')temp[i]='B';
						if(temp[i+1]=='B')temp[i]='R';
					}
					if(temp[i-1]=='B') {
						if(temp[i+1]=='B')temp[i]='R';
						if(temp[i+1]=='G')temp[i]='R';
						if(temp[i+1]=='R')temp[i]='G';
					}
				}
				cnt++;
			}
		}
		System.out.println(cnt);
		for (int i = 0; i < temp.length; i++) {
			System.out.print(temp[i]);
		}
		out.flush();
	}

}
class Readers {

    static BufferedReader reader;

    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */

    static void init(InputStream input) {

        reader = new BufferedReader(

                     new InputStreamReader(input) );

        tokenizer = new StringTokenizer("");

    }

    /** get next word */

    static String next() throws IOException {

        while ( ! tokenizer.hasMoreTokens() ) {

            //TODO add check for eof if necessary

            tokenizer = new StringTokenizer(

                   reader.readLine() );

        }

        return tokenizer.nextToken();

    }

    static int nextInt() throws IOException {

        return Integer.parseInt( next() );

    }

    static double nextDouble() throws IOException {

        return Double.parseDouble( next() );

    }

    static long nextLong() throws IOException{

		return Long.parseLong(next());
	}

}


import java.util.*;
public class GFG {
	public static void main (String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		String s=sc.next();
		char ch[]=s.toCharArray();
		int c=0;
		for(int i=1;i<n-1;i++)
		{
		    if(ch[i]==ch[i-1]&&ch[i]==ch[i+1])
		    {
		        c++;
		        if(ch[i]=='R'){
		        ch[i]='G';continue;}
		        if(ch[i]=='G'){
		        ch[i]='B';continue;}
		        if(ch[i]=='B'){
		        ch[i]='R';continue;}
		   }
		}
	    HashSet<Character> h=new HashSet<Character>();
        h.add('R');
        h.add('G');
        h.add('B');

		for(int i=0;i<((n==1)?0:n);i++)
		{

		    if(i==0&&ch[i]==ch[i+1])
		    {
		           c++;
		        if(ch[i]=='R'){
		        ch[i]='G';continue;}
		        if(ch[i]=='G'){
		        ch[i]='B';continue;}
		        if(ch[i]=='B'){
		        ch[i]='R';continue;}
		    }
		    if(i==n-1&&ch[i]==ch[i-1])
		    {
		        c++;
		         if(ch[i]=='R'){
		        ch[i]='G';continue;}
		        if(ch[i]=='G'){
		        ch[i]='B';continue;}
		        if(ch[i]=='B'){
		        ch[i]='R';continue;}
		    }
		    if(i!=0&&i!=n-1&&ch[i]==ch[i+1])
		    {     c++;
		          h.remove(ch[i-1]);
		          h.remove(ch[i+1]);
		          if(h.contains('R'))
		          ch[i]='R';
		          if(h.contains('G'))
		          ch[i]='G';
		          if(h.contains('B'))
		          ch[i]='B';
		          h.add(ch[i-1]);
		          h.add(ch[i+1]);
		          continue;
		    }
		}
		System.out.println(c);
		System.out.println(String.valueOf(ch));
	}
}


import java.io.*;
import java.math.*;
import java.nio.charset.IllegalCharsetNameException;
import java.util.*;

// printArr() - prints the array
// intList, doubleList, longList
// nextIntArray

/* stuff you should look for
 * int overflow, array bounds
 * special cases (n=1?)
 * do smth instead of nothing and stay organized
 * WRITE STUFF DOWN
 */

public class current {
    public static void main(String[] args) {
        FastReader fr = new FastReader();
        fr.nextLine();
        solve(fr.nextLine().toCharArray());
    }

    public static void solve(char[] arr) {
        Map<Integer, Integer> map = new HashMap<>();
        char cur = arr[0];
        int l = arr.length;
        if (l == 1) {
            System.out.println(0);
            System.out.println(String.valueOf(arr));
            return;
        }
        int cursum = 1;
        int start = 0;
        for (int i = 1; i < l; i++) {
            if (arr[i] == cur) {
                cursum++;
            } else {
                if (cursum > 1) {
                    map.put(start, cursum);
                }
                start = i;
                cur = arr[i];
                cursum = 1;
            }
        }
        if (cursum > 1) {
            map.put(start, cursum);
        }
        int sum = 0;
        for (int i : map.keySet()) {
            int length = map.get(i);
            if (length % 2 == 1) {
                for (int j = i+1; j < i+length; j += 2) {
                    sum++;
                    arr[j] = getChar(arr[j-1], arr[j+1]);
                }
            } else {
                for (int j = i; j < i+length-1; j += 2) {
                    if (j == 0) {
                        arr[0] = getChar(arr[1]);
                    } else {
                        arr[j] = getChar(arr[j-1], arr[j+1]);
                    }
                    sum++;
                }
            }
        }
        System.out.println(sum);
        System.out.println(String.valueOf(arr));
    }

    public static char getChar(char a, char b) {
        Set<Character> set = new HashSet<>();
        set.add('B');
        set.add('R');
        set.add('G');
        set.remove(a);
        set.remove(b);
        for (char i : set) {
            return i;
        }
        return 'R';
    }

    public static char getChar(char a) {
        Set<Character> set = new HashSet<>();
        set.add('B');
        set.add('R');
        set.add('G');
        set.remove(a);
        for (char i : set) {
            return i;
        }
        return 'R';
    }

    public static Set<Integer> get(List<Set<Integer>> graph, int i) {
        try {
            return graph.get(i);
        } catch (IndexOutOfBoundsException e) {
            return new HashSet<>();
        }
    }

    public static void printArr(int[] a) {
        System.out.println(Arrays.toString(a));
    }

    public static int[] bfs(List<Set<Integer>> graph, int v) {
        int l = graph.size();
        Deque<Integer> list = new ArrayDeque<>();
        list.add(v);
        boolean[] seen = new boolean[l];
        int distance = 0;
        int node = v;
        int size = 1;
        int index = 0;
        // Iterate over every single vertice and edge
        // O(V+E) -> O(V) for trees
        while (!list.isEmpty()) {
            int cur = list.poll();
            seen[cur] = true;
            node = cur;

            index++;
            if (index > size) {
                distance++;
                size = list.size();
                index = 0;
            }

            for (int i : graph.get(cur)) {
                if (!seen[i]) {
                    seen[i] = true;
                    list.add(i);
                }
            }
        }
        return new int[]{node, distance};
    }

    static class SegTree {
        int startIndex, endIndex;
        long sum;
        SegTree lchild, rchild;

        SegTree(int[] arr) {this(0, arr.length-1, arr);}

        SegTree(int startIndex, int endIndex, int[] arr) {
            this.startIndex = startIndex;
            this.endIndex = endIndex;
            if (startIndex == endIndex) sum = arr[startIndex];
            else {
                int mid = (startIndex + endIndex) / 2;
                lchild = new SegTree(startIndex, mid, arr);
                rchild = new SegTree(mid + 1, endIndex, arr);
                sum = lchild.sum + rchild.sum;
                recalc();
            }
        }

        void recalc() {
            if (startIndex == endIndex) return; sum = lchild.sum + rchild.sum;
        }

        public void valueUpdate(int index, int value) {
            if (startIndex == endIndex) {sum = value; return;}
            if (index > lchild.endIndex) rchild.valueUpdate(index, value); else lchild.valueUpdate(index, value); recalc();
        }

        public long rangeSum(int startIndex, int endIndex) {
            if (endIndex < this.startIndex || startIndex > this.endIndex) return 0;
            if (startIndex <= this.startIndex && endIndex >= this.endIndex) return sum;
            return lchild.rangeSum(startIndex, endIndex) + rchild.rangeSum(startIndex, endIndex);
        }
    }

    public static double sum(List<Long> n) {
        double a = 0;
        for (long i : n) {
            a += i;
        }
        return a;
    }

    public static int toInt(String n) {
        return Integer.parseInt(n);
    }

    public static double toDouble(String n) {
        return Double.parseDouble(n);
    }

    public static long toLong(String n) {
        return Long.parseLong(n);
    }

    static class FastReader {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;

        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());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        String nextLine() {
            String a = "";
            try {
                a = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return a;
        }

        int[] nextIntArray() {
            return intArray(nextLine().split(" "));
        }

        long[] nextLongArray() {
            return longArray(nextLine().split(" "));
        }

        double[] nextDoubleArray() {
            return doubleArray(nextLine().split(" "));
        }

        public int getInt(int index) {
            String[] arr = nextLine().split(" ");
            return Integer.parseInt(arr[index]);
        }

        public long getLong(int index) {
            String[] arr = nextLine().split(" ");
            return Long.parseLong(arr[index]);
        }

        public double getDouble(int index) {
            String[] arr = nextLine().split(" ");
            return Double.parseDouble(arr[index]);
        }

        public List<String> stringList() {
            String[] arr = nextLine().split(" ");
            return Arrays.asList(arr);
        }

        public List<Integer> intList() {
            String[] arr = nextLine().split(" ");
            List<Integer> a = new ArrayList<>();
            for (String i : arr) {
                a.add(Integer.parseInt(i));
            }
            return a;
        }

        public List<Double> doubleList() {
            String[] arr = nextLine().split(" ");
            List<Double> a = new ArrayList<>();
            for (String i : arr) {
                a.add(Double.parseDouble(i));
            }
            return a;
        }

        public List<Long> longList() {
            String[] arr = nextLine().split(" ");
            List<Long> a = new ArrayList<>();
            for (String i : arr) {
                a.add(Long.parseLong(i));
            }
            return a;
        }
    }

    public static int[] intArray(String[] arr) {
        int l = arr.length;
        int[] a = new int[l];
        for (int i = 0; i < l; i++) {
            a[i] = Integer.parseInt(arr[i]);
        }
        return a;
    }

    public static long[] longArray(String[] arr) {
        int l = arr.length;
        long[] a = new long[l];
        for (int i = 0; i < l; i++) {
            a[i] = Long.parseLong(arr[i]);
        }
        return a;
    }

    public static double[] doubleArray(String[] arr) {
        int l = arr.length;
        double[] a = new double[l];
        for (int i = 0; i < l; i++) {
            a[i] = Double.parseDouble(arr[i]);
        }
        return a;
    }
}


import java.io.*;
import java.math.*;
import java.nio.charset.IllegalCharsetNameException;
import java.util.*;

// printArr() - prints the array
// intList, doubleList, longList
// nextIntArray

/* stuff you should look for
 * int overflow, array bounds
 * special cases (n=1?)
 * do smth instead of nothing and stay organized
 * WRITE STUFF DOWN
 */

public class current {
    public static void main(String[] args) {
        FastReader fr = new FastReader();
        while (true) {
            fr.nextLine();
            solve(fr.nextLine().toCharArray());
        }
    }

    public static void solve(char[] arr) {
        Map<Integer, Integer> map = new HashMap<>();
        char cur = arr[0];
        int l = arr.length;
        if (l == 1) {
            System.out.println(0);
            System.out.println(String.valueOf(arr));
            return;
        }
        int cursum = 1;
        int start = 0;
        for (int i = 1; i < l; i++) {
            if (arr[i] == cur) {
                cursum++;
            } else {
                if (cursum > 1) {
                    map.put(start, cursum);
                }
                start = i;
                cur = arr[i];
                cursum = 1;
            }
        }
        if (cursum > 1) {
            map.put(start, cursum);
        }
        int sum = 0;
        for (int i : map.keySet()) {
            int length = map.get(i);
            if (length % 2 == 1) {
                for (int j = i+1; j < i+length; j += 2) {
                    sum++;
                    arr[j] = getChar(arr[j-1], arr[j+1]);
                }
            } else {
                for (int j = i; j < i+length-1; j += 2) {
                    if (j == 0) {
                        arr[0] = getChar(arr[1]);
                    } else {
                        arr[j] = getChar(arr[j-1], arr[j+1]);
                    }
                    sum++;
                }
            }
        }
        System.out.println(sum);
        System.out.println(String.valueOf(arr));
    }

    public static char getChar(char a, char b) {
        Set<Character> set = new HashSet<>();
        set.add('B');
        set.add('R');
        set.add('G');
        set.remove(a);
        set.remove(b);
        for (char i : set) {
            return i;
        }
        return 'R';
    }

    public static char getChar(char a) {
        Set<Character> set = new HashSet<>();
        set.add('B');
        set.add('R');
        set.add('G');
        set.remove(a);
        for (char i : set) {
            return i;
        }
        return 'R';
    }

    public static Set<Integer> get(List<Set<Integer>> graph, int i) {
        try {
            return graph.get(i);
        } catch (IndexOutOfBoundsException e) {
            return new HashSet<>();
        }
    }

    public static void printArr(int[] a) {
        System.out.println(Arrays.toString(a));
    }

    public static int[] bfs(List<Set<Integer>> graph, int v) {
        int l = graph.size();
        Deque<Integer> list = new ArrayDeque<>();
        list.add(v);
        boolean[] seen = new boolean[l];
        int distance = 0;
        int node = v;
        int size = 1;
        int index = 0;
        // Iterate over every single vertice and edge
        // O(V+E) -> O(V) for trees
        while (!list.isEmpty()) {
            int cur = list.poll();
            seen[cur] = true;
            node = cur;

            index++;
            if (index > size) {
                distance++;
                size = list.size();
                index = 0;
            }

            for (int i : graph.get(cur)) {
                if (!seen[i]) {
                    seen[i] = true;
                    list.add(i);
                }
            }
        }
        return new int[]{node, distance};
    }

    static class SegTree {
        int startIndex, endIndex;
        long sum;
        SegTree lchild, rchild;

        SegTree(int[] arr) {this(0, arr.length-1, arr);}

        SegTree(int startIndex, int endIndex, int[] arr) {
            this.startIndex = startIndex;
            this.endIndex = endIndex;
            if (startIndex == endIndex) sum = arr[startIndex];
            else {
                int mid = (startIndex + endIndex) / 2;
                lchild = new SegTree(startIndex, mid, arr);
                rchild = new SegTree(mid + 1, endIndex, arr);
                sum = lchild.sum + rchild.sum;
                recalc();
            }
        }

        void recalc() {
            if (startIndex == endIndex) return; sum = lchild.sum + rchild.sum;
        }

        public void valueUpdate(int index, int value) {
            if (startIndex == endIndex) {sum = value; return;}
            if (index > lchild.endIndex) rchild.valueUpdate(index, value); else lchild.valueUpdate(index, value); recalc();
        }

        public long rangeSum(int startIndex, int endIndex) {
            if (endIndex < this.startIndex || startIndex > this.endIndex) return 0;
            if (startIndex <= this.startIndex && endIndex >= this.endIndex) return sum;
            return lchild.rangeSum(startIndex, endIndex) + rchild.rangeSum(startIndex, endIndex);
        }
    }

    public static double sum(List<Long> n) {
        double a = 0;
        for (long i : n) {
            a += i;
        }
        return a;
    }

    public static int toInt(String n) {
        return Integer.parseInt(n);
    }

    public static double toDouble(String n) {
        return Double.parseDouble(n);
    }

    public static long toLong(String n) {
        return Long.parseLong(n);
    }

    static class FastReader {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;

        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());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        String nextLine() {
            String a = "";
            try {
                a = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return a;
        }

        int[] nextIntArray() {
            return intArray(nextLine().split(" "));
        }

        long[] nextLongArray() {
            return longArray(nextLine().split(" "));
        }

        double[] nextDoubleArray() {
            return doubleArray(nextLine().split(" "));
        }

        public int getInt(int index) {
            String[] arr = nextLine().split(" ");
            return Integer.parseInt(arr[index]);
        }

        public long getLong(int index) {
            String[] arr = nextLine().split(" ");
            return Long.parseLong(arr[index]);
        }

        public double getDouble(int index) {
            String[] arr = nextLine().split(" ");
            return Double.parseDouble(arr[index]);
        }

        public List<String> stringList() {
            String[] arr = nextLine().split(" ");
            return Arrays.asList(arr);
        }

        public List<Integer> intList() {
            String[] arr = nextLine().split(" ");
            List<Integer> a = new ArrayList<>();
            for (String i : arr) {
                a.add(Integer.parseInt(i));
            }
            return a;
        }

        public List<Double> doubleList() {
            String[] arr = nextLine().split(" ");
            List<Double> a = new ArrayList<>();
            for (String i : arr) {
                a.add(Double.parseDouble(i));
            }
            return a;
        }

        public List<Long> longList() {
            String[] arr = nextLine().split(" ");
            List<Long> a = new ArrayList<>();
            for (String i : arr) {
                a.add(Long.parseLong(i));
            }
            return a;
        }
    }

    public static int[] intArray(String[] arr) {
        int l = arr.length;
        int[] a = new int[l];
        for (int i = 0; i < l; i++) {
            a[i] = Integer.parseInt(arr[i]);
        }
        return a;
    }

    public static long[] longArray(String[] arr) {
        int l = arr.length;
        long[] a = new long[l];
        for (int i = 0; i < l; i++) {
            a[i] = Long.parseLong(arr[i]);
        }
        return a;
    }

    public static double[] doubleArray(String[] arr) {
        int l = arr.length;
        double[] a = new double[l];
        for (int i = 0; i < l; i++) {
            a[i] = Double.parseDouble(arr[i]);
        }
        return a;
    }
}


#include <climits>
#include <queue>
#include <vector>
#include <map>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>  // istringstream buffer(myString);
#include <stack>
#include <algorithm>  //swap function is here
#include <cstring>
#include <cassert>
#include <bits/stdc++.h>
using namespace std;

#define bit(x,i) (x&(1<<i))  //select the bit of position i of x
#define lowbit(x) ((x)&((x)^((x)-1))) //get the lowest bit of x
#define hBit(msb,n) asm("bsrl %1,%0" : "=r"(msb) : "r"(n)) //get the highest bit of x, maybe the fastest
#define max(a,b) (a<b?b:a)

#define IN(i,l,r) (l<i&&i<r) //the next for are for checking bound
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define F(i,L,R) for (int i = L; i < R; i++) //next four are for "for loops"
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define FF(i,L,R) for (int i = L; i > R; i--)
#define FFE(i,L,R) for (int i = L; i >= R; i--)
#define getI(a) scanf("%d", &a) //next three are handy ways to get ints, it's also force you to use '&' sign
#define getII(a,b) scanf("%d%d", &a, &b)
#define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c)
#define wez(n) int (n); scanf("%d",&(n)) //handy if the input is right after the definition of a variable
#define wez2(n,m) int (n),(m); scanf("%d %d",&(n),&(m))
#define wez3(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k))
#define TESTS wez(testow)while(testow--) //for multilple cases problems
#define whileZ int T; getI(T); while(T--) // the same as above
#define getS(x) scanf("%s", x) //get a char* string
#define clr(a,x) memset(a,x,sizeof(a)) //set elements of array to some value
#define char2Int(c) (c-'0')
#define lastEle(vec) vec[vec.size()-1]
#define SZ(x) ((int)((x).size()))
#define REMAX(a,b) (a)=max((a),(b)) // set a to the maximum of a and b
#define REMIN(a,b) (a)=min((a),(b));
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) // traverse an STL data structure
#define ALL(c) (c).begin(),(c).end() //handy for function like "sort()"
#define PRESENT(c,x) ((c).find(x) != (c).end())
#define CPRESENT(c,x) (find(ALL(c),x) != (c).end())
#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF 1001001001
#define PI 3.1415926535897932384626
//for map, pair
#define mp make_pair
#define fi first
#define se second
// for debug
inline void pisz(int n) { printf("%d\n",n); }
#define DBG(vari) cerr<<#vari<<" = "<<(vari)<<endl;
#define printA(a,L,R) FE(i,L,R) cout << a[i] << (i==R?'\n':' ')
#define printV(a) printA(a,0,a.size()-1)
#define MAXN 10000
//for vectors
#define pb push_back
typedef int elem_t;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
// directions
const int fx[4][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}};
const int fxx[8][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}, {1,1}, {1,-1}, {-1,1}, {-1,-1}};
template<typename T,typename TT> ostream& operator<<(ostream &s,pair<T,TT> t) {return s<<"("<<t.first<<","<<t.second<<")";}
template<typename T> ostream& operator<<(ostream &s,vector<T> t){F(i,0,SZ(t))s<<t[i]<<" ";return s; }

int main()
{
ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ll n;
  std::vector<int> arr(n,0); ll flag=0; std::vector<int> v; cin>>arr[0];
  for (int i = 1; i <n; ++i)
  {cin>>arr[i];
   if(arr[i]==arr[i-1])
   {count++;
   	flag=1;
   }
   else
   {v.push_back(count);
   	flag=0;
   	count=1;
   }

  }ll f=0;
  for (int i = 0; i <v.size(); ++i)
  {if(v[i]>1)
  	{f=f+v[i]/3+v[i]%3;

  	}
  	/* code */
  }
  cout<<f<<"\n";
}


#include <climits>
#include <queue>
#include <vector>
#include <map>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>  // istringstream buffer(myString);
#include <stack>
#include <algorithm>  //swap function is here
#include <cstring>
#include <cassert>
#include <bits/stdc++.h>
using namespace std;

#define bit(x,i) (x&(1<<i))  //select the bit of position i of x
#define lowbit(x) ((x)&((x)^((x)-1))) //get the lowest bit of x
#define hBit(msb,n) asm("bsrl %1,%0" : "=r"(msb) : "r"(n)) //get the highest bit of x, maybe the fastest
#define max(a,b) (a<b?b:a)

#define IN(i,l,r) (l<i&&i<r) //the next for are for checking bound
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define F(i,L,R) for (int i = L; i < R; i++) //next four are for "for loops"
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define FF(i,L,R) for (int i = L; i > R; i--)
#define FFE(i,L,R) for (int i = L; i >= R; i--)
#define getI(a) scanf("%d", &a) //next three are handy ways to get ints, it's also force you to use '&' sign
#define getII(a,b) scanf("%d%d", &a, &b)
#define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c)
#define wez(n) int (n); scanf("%d",&(n)) //handy if the input is right after the definition of a variable
#define wez2(n,m) int (n),(m); scanf("%d %d",&(n),&(m))
#define wez3(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k))
#define TESTS wez(testow)while(testow--) //for multilple cases problems
#define whileZ int T; getI(T); while(T--) // the same as above
#define getS(x) scanf("%s", x) //get a char* string
#define clr(a,x) memset(a,x,sizeof(a)) //set elements of array to some value
#define char2Int(c) (c-'0')
#define lastEle(vec) vec[vec.size()-1]
#define SZ(x) ((int)((x).size()))
#define REMAX(a,b) (a)=max((a),(b)) // set a to the maximum of a and b
#define REMIN(a,b) (a)=min((a),(b));
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) // traverse an STL data structure
#define ALL(c) (c).begin(),(c).end() //handy for function like "sort()"
#define PRESENT(c,x) ((c).find(x) != (c).end())
#define CPRESENT(c,x) (find(ALL(c),x) != (c).end())
#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF 1001001001
#define PI 3.1415926535897932384626
//for map, pair
#define mp make_pair
#define fi first
#define se second
// for debug
inline void pisz(int n) { printf("%d\n",n); }
#define DBG(vari) cerr<<#vari<<" = "<<(vari)<<endl;
#define printA(a,L,R) FE(i,L,R) cout << a[i] << (i==R?'\n':' ')
#define printV(a) printA(a,0,a.size()-1)
#define MAXN 10000
//for vectors
#define pb push_back
typedef int elem_t;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
// directions
const int fx[4][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}};
const int fxx[8][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}, {1,1}, {1,-1}, {-1,1}, {-1,-1}};
template<typename T,typename TT> ostream& operator<<(ostream &s,pair<T,TT> t) {return s<<"("<<t.first<<","<<t.second<<")";}
template<typename T> ostream& operator<<(ostream &s,vector<T> t){F(i,0,SZ(t))s<<t[i]<<" ";return s; }

int main()
{
ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ll n; cin>>n;
 ll flag=0; std::vector<int> v;ll count=1; string arr;
  cin>>arr;

  for (int i = 1; i <arr.size(); ++i)
  {
   if(arr[i]==arr[i-1])
   {count++;
    std::vector<int> temp(3,0);
     if(arr[i-1]=='R')
     {temp[0]++;

     }
     else if(arr[i-1]=='G')
     {temp[1]++;

     }
     else
     {
      temp[2]++;
     }
     for (int k = 0; k<3; ++k)
     {if(temp[k]==0)
      {if(k==0)
        arr[i]='R';
        else if(k==1)
  arr[i]='G';
        else
        arr[i]='B';
        break;
       /* code */
      }
     }
   	flag=1;
   }
   else
   {
     v.push_back(count);
   	flag=0;
   	count=1;
   }

  }	v.push_back(count);ll f=0;

  for (int i = 0; i <v.size(); ++i)
  {//cout<<"v:"<<v[i]<<"\n";
    if(v[i]%3==0)
  	{f=f+v[i]/3;

  	}
    else
    {
      f=f+v[i]/2;
    }
  	/* code */
  }
  cout<<f<<"\n";
  cout<<arr<<"\n";
}


#include <climits>
#include <queue>
#include <vector>
#include <map>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>  // istringstream buffer(myString);
#include <stack>
#include <algorithm>  //swap function is here
#include <cstring>
#include <cassert>
#include <bits/stdc++.h>
using namespace std;

#define bit(x,i) (x&(1<<i))  //select the bit of position i of x
#define lowbit(x) ((x)&((x)^((x)-1))) //get the lowest bit of x
#define hBit(msb,n) asm("bsrl %1,%0" : "=r"(msb) : "r"(n)) //get the highest bit of x, maybe the fastest
#define max(a,b) (a<b?b:a)

#define IN(i,l,r) (l<i&&i<r) //the next for are for checking bound
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define F(i,L,R) for (int i = L; i < R; i++) //next four are for "for loops"
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define FF(i,L,R) for (int i = L; i > R; i--)
#define FFE(i,L,R) for (int i = L; i >= R; i--)
#define getI(a) scanf("%d", &a) //next three are handy ways to get ints, it's also force you to use '&' sign
#define getII(a,b) scanf("%d%d", &a, &b)
#define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c)
#define wez(n) int (n); scanf("%d",&(n)) //handy if the input is right after the definition of a variable
#define wez2(n,m) int (n),(m); scanf("%d %d",&(n),&(m))
#define wez3(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k))
#define TESTS wez(testow)while(testow--) //for multilple cases problems
#define whileZ int T; getI(T); while(T--) // the same as above
#define getS(x) scanf("%s", x) //get a char* string
#define clr(a,x) memset(a,x,sizeof(a)) //set elements of array to some value
#define char2Int(c) (c-'0')
#define lastEle(vec) vec[vec.size()-1]
#define SZ(x) ((int)((x).size()))
#define REMAX(a,b) (a)=max((a),(b)) // set a to the maximum of a and b
#define REMIN(a,b) (a)=min((a),(b));
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) // traverse an STL data structure
#define ALL(c) (c).begin(),(c).end() //handy for function like "sort()"
#define PRESENT(c,x) ((c).find(x) != (c).end())
#define CPRESENT(c,x) (find(ALL(c),x) != (c).end())
#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF 1001001001
#define PI 3.1415926535897932384626
//for map, pair
#define mp make_pair
#define fi first
#define se second
// for debug
inline void pisz(int n) { printf("%d\n",n); }
#define DBG(vari) cerr<<#vari<<" = "<<(vari)<<endl;
#define printA(a,L,R) FE(i,L,R) cout << a[i] << (i==R?'\n':' ')
#define printV(a) printA(a,0,a.size()-1)
#define MAXN 10000
//for vectors
#define pb push_back
typedef int elem_t;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
// directions
const int fx[4][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}};
const int fxx[8][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}, {1,1}, {1,-1}, {-1,1}, {-1,-1}};
template<typename T,typename TT> ostream& operator<<(ostream &s,pair<T,TT> t) {return s<<"("<<t.first<<","<<t.second<<")";}
template<typename T> ostream& operator<<(ostream &s,vector<T> t){F(i,0,SZ(t))s<<t[i]<<" ";return s; }

int main()
{
ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ll n; cin>>n;
 ll flag=0; std::vector<int> v;ll count=0; string arr;
  cin>>arr;

  for (int i = 1; i <arr.size(); ++i)
  {
   if(arr[i]==arr[i-1])
   {count++;
    std::vector<int> temp(3,0);
     if(arr[i-1]=='R')
     {temp[0]++;

     }
     else if(arr[i-1]=='G')
     {temp[1]++;

     }
     else
     {
      temp[2]++;
     }
     for (int k = 0; k<3; ++k)
     {if(temp[k]==0)
      {if(k==0)
        arr[i]='R';
        else if(k==1)
  arr[i]='G';
        else
        arr[i]='B';
        break;
       /* code */
      }
     }
   	flag=1;
   }
   else
   {
     v.push_back(count);
   	flag=0;

   }

  }	v.push_back(count);ll f=0;

  for (int i = 0; i <v.size(); ++i)
  {//cout<<"v:"<<v[i]<<"\n";
    if(v[i]%3==0&&v[i]>1)
  	{f=f+v[i]/3;

  	}
    else if(v[i]>1)
    {
      f=f+v[i]/2;
    }
  	/* code */
  }
  cout<<count<<"\n";
  cout<<arr<<"\n";
}


#include <climits>
#include <queue>
#include <vector>
#include <map>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>  // istringstream buffer(myString);
#include <stack>
#include <algorithm>  //swap function is here
#include <cstring>
#include <cassert>
#include <bits/stdc++.h>
using namespace std;

#define bit(x,i) (x&(1<<i))  //select the bit of position i of x
#define lowbit(x) ((x)&((x)^((x)-1))) //get the lowest bit of x
#define hBit(msb,n) asm("bsrl %1,%0" : "=r"(msb) : "r"(n)) //get the highest bit of x, maybe the fastest
#define max(a,b) (a<b?b:a)

#define IN(i,l,r) (l<i&&i<r) //the next for are for checking bound
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define F(i,L,R) for (int i = L; i < R; i++) //next four are for "for loops"
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define FF(i,L,R) for (int i = L; i > R; i--)
#define FFE(i,L,R) for (int i = L; i >= R; i--)
#define getI(a) scanf("%d", &a) //next three are handy ways to get ints, it's also force you to use '&' sign
#define getII(a,b) scanf("%d%d", &a, &b)
#define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c)
#define wez(n) int (n); scanf("%d",&(n)) //handy if the input is right after the definition of a variable
#define wez2(n,m) int (n),(m); scanf("%d %d",&(n),&(m))
#define wez3(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k))
#define TESTS wez(testow)while(testow--) //for multilple cases problems
#define whileZ int T; getI(T); while(T--) // the same as above
#define getS(x) scanf("%s", x) //get a char* string
#define clr(a,x) memset(a,x,sizeof(a)) //set elements of array to some value
#define char2Int(c) (c-'0')
#define lastEle(vec) vec[vec.size()-1]
#define SZ(x) ((int)((x).size()))
#define REMAX(a,b) (a)=max((a),(b)) // set a to the maximum of a and b
#define REMIN(a,b) (a)=min((a),(b));
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) // traverse an STL data structure
#define ALL(c) (c).begin(),(c).end() //handy for function like "sort()"
#define PRESENT(c,x) ((c).find(x) != (c).end())
#define CPRESENT(c,x) (find(ALL(c),x) != (c).end())
#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF 1001001001
#define PI 3.1415926535897932384626
//for map, pair
#define mp make_pair
#define fi first
#define se second
// for debug
inline void pisz(int n) { printf("%d\n",n); }
#define DBG(vari) cerr<<#vari<<" = "<<(vari)<<endl;
#define printA(a,L,R) FE(i,L,R) cout << a[i] << (i==R?'\n':' ')
#define printV(a) printA(a,0,a.size()-1)
#define MAXN 10000
//for vectors
#define pb push_back
typedef int elem_t;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
// directions
const int fx[4][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}};
const int fxx[8][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}, {1,1}, {1,-1}, {-1,1}, {-1,-1}};
template<typename T,typename TT> ostream& operator<<(ostream &s,pair<T,TT> t) {return s<<"("<<t.first<<","<<t.second<<")";}
template<typename T> ostream& operator<<(ostream &s,vector<T> t){F(i,0,SZ(t))s<<t[i]<<" ";return s; }

int main()
{
ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ll n; cin>>n;
 ll flag=0; std::vector<int> v;ll count=0; string arr;
  cin>>arr;

  for (int i = 1; i <arr.size(); ++i)
  {
   if(arr[i]==arr[i-1])
   {count++;
    std::vector<int> temp(3,0);
     if(arr[i-1]=='R')
     {temp[0]++;

     }
     else if(arr[i-1]=='G')
     {temp[1]++;

     }
     else
     {
      temp[2]++;
     }
     if(arr[i+1]=='R')
     {temp[0]++;

     }
     else if(arr[i+1]=='G')
     {temp[1]++;

     }
     else
     {
      temp[2]++;
     }
     for (int k = 0; k<3; ++k)
     {if(temp[k]==0)
      {if(k==0)
        arr[i]='R';
        else if(k==1)
  arr[i]='G';
        else
        arr[i]='B';
        break;
       /* code */
      }
     }
   	flag=1;
   }
   else
   {
     v.push_back(count);
   	flag=0;

   }

  }	v.push_back(count);ll f=0;

  for (int i = 0; i <v.size(); ++i)
  {//cout<<"v:"<<v[i]<<"\n";
    if(v[i]%3==0&&v[i]>1)
  	{f=f+v[i]/3;

  	}
    else if(v[i]>1)
    {
      f=f+v[i]/2;
    }
  	/* code */
  }
  cout<<count<<"\n";
  cout<<arr<<"\n";
}


#include <climits>
#include <queue>
#include <vector>
#include <map>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>  // istringstream buffer(myString);
#include <stack>
#include <algorithm>  //swap function is here
#include <cstring>
#include <cassert>
#include <bits/stdc++.h>
using namespace std;

#define bit(x,i) (x&(1<<i))  //select the bit of position i of x
#define lowbit(x) ((x)&((x)^((x)-1))) //get the lowest bit of x
#define hBit(msb,n) asm("bsrl %1,%0" : "=r"(msb) : "r"(n)) //get the highest bit of x, maybe the fastest
#define max(a,b) (a<b?b:a)

#define IN(i,l,r) (l<i&&i<r) //the next for are for checking bound
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define F(i,L,R) for (int i = L; i < R; i++) //next four are for "for loops"
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define FF(i,L,R) for (int i = L; i > R; i--)
#define FFE(i,L,R) for (int i = L; i >= R; i--)
#define getI(a) scanf("%d", &a) //next three are handy ways to get ints, it's also force you to use '&' sign
#define getII(a,b) scanf("%d%d", &a, &b)
#define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c)
#define wez(n) int (n); scanf("%d",&(n)) //handy if the input is right after the definition of a variable
#define wez2(n,m) int (n),(m); scanf("%d %d",&(n),&(m))
#define wez3(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k))
#define TESTS wez(testow)while(testow--) //for multilple cases problems
#define whileZ int T; getI(T); while(T--) // the same as above
#define getS(x) scanf("%s", x) //get a char* string
#define clr(a,x) memset(a,x,sizeof(a)) //set elements of array to some value
#define char2Int(c) (c-'0')
#define lastEle(vec) vec[vec.size()-1]
#define SZ(x) ((int)((x).size()))
#define REMAX(a,b) (a)=max((a),(b)) // set a to the maximum of a and b
#define REMIN(a,b) (a)=min((a),(b));
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) // traverse an STL data structure
#define ALL(c) (c).begin(),(c).end() //handy for function like "sort()"
#define PRESENT(c,x) ((c).find(x) != (c).end())
#define CPRESENT(c,x) (find(ALL(c),x) != (c).end())
#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF 1001001001
#define PI 3.1415926535897932384626
//for map, pair
#define mp make_pair
#define fi first
#define se second
// for debug
inline void pisz(int n) { printf("%d\n",n); }
#define DBG(vari) cerr<<#vari<<" = "<<(vari)<<endl;
#define printA(a,L,R) FE(i,L,R) cout << a[i] << (i==R?'\n':' ')
#define printV(a) printA(a,0,a.size()-1)
#define MAXN 10000
//for vectors
#define pb push_back
typedef int elem_t;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
// directions
const int fx[4][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}};
const int fxx[8][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}, {1,1}, {1,-1}, {-1,1}, {-1,-1}};
template<typename T,typename TT> ostream& operator<<(ostream &s,pair<T,TT> t) {return s<<"("<<t.first<<","<<t.second<<")";}
template<typename T> ostream& operator<<(ostream &s,vector<T> t){F(i,0,SZ(t))s<<t[i]<<" ";return s; }

int main()
{
ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ll n; cin>>n;
 ll flag=0; std::vector<int> v;ll count=1; string arr;
  cin>>arr;

  for (int i = 1; i <arr.size(); ++i)
  {
   if(arr[i]==arr[i-1])
   {count++;
    std::vector<int> temp(3,0);
     if(arr[i-1]=='R')
     {temp[0]++;

     }
     else if(arr[i-1]=='G')
     {temp[1]++;

     }
     else
     {
      temp[2]++;
     }
     for (int k = 0; k<3; ++k)
     {if(temp[k]==0)
      {
        arr[i]=k;
        break;
       /* code */
      }
     }
   	flag=1;
   }
   else
   {
     v.push_back(count);
   	flag=0;
   	count=1;
   }

  }	v.push_back(count);ll f=0;
  for (int i = 0; i < n; ++i)
  {if(arr[i]=='0')
   {
     arr[i]='R';
   }
   else if(arr[i]=='1')
   {arr[i]='G';

   }
   else if(arr[i]=='2')
   {arr[i]='B';

   }
    /* code */
  }
  for (int i = 0; i <v.size(); ++i)
  {//cout<<"v:"<<v[i]<<"\n";
    if(v[i]%3==0)
  	{f=f+v[i]/3;

  	}
    else
    {
      f=f+v[i]/2;
    }
  	/* code */
  }
  cout<<f<<"\n";
  cout<<arr<<"\n";
}


#include <bits/stdc++.h>
using namespace std;

main() {
  string s;
  int n;
  cin>>n>>s;
  string h="RGB";
  int ans=0;
  if(n==2){
  	int ans=0;
    if(s[0]==s[1]){
      if(s[0]=='G'){
        s[1]='R';
        ans++;
      }
      else if(s[0]=='R'){
        s[1]='G';
        ans++;
      }
      else{
        s[1]='G';
        ans++;
      }