// Arup Guha
// 11/11/2017
// Solution to 2017 SER D2 Problem: Purple Rain

import java.util.*;

public class purplerain {

	public static String s;

	public static void main(String[] args) {

		// Read the input.
		Scanner stdin = new Scanner(System.in);
		s = stdin.next();

		// Solve both ways.
		int[] bSol = solve('B');
		int[] rSol = solve('R');

		// Take the better one.
		int[] res = getBest(bSol, rSol);
		System.out.println((res[0]+1) + " " + (res[1]+1));
	}

	// Return the better solution of a and b.
	public static int[] getBest(int[] a, int[] b) {

		// These are easy.
		if (a[2] > b[2]) return a;
		if (b[2] > a[2]) return b;

		// Could never have the same starting indexes.
		if (a[0] < b[0]) return a;
		return b;
	}

	// Run MCSS with +1 = c, -1 = other, and return best solution and bounds of it.
	public static int[] solve(char c) {

		// Initial answer.
		int res = 0, start = 0, cur = 0;
		int[] bounds = new int[3];
		Arrays.fill(bounds, -1);

		// First look for MCSS with B = 1, R = -1.
		for (int i=0; i<s.length(); i++) {

			cur += s.charAt(i) == c ? 1 : -1;

			// Found a new MCSS
			if (cur > res) {
				res = cur;
				bounds[0] = start;
				bounds[1] = i;
				bounds[2] = res;
			}

			// Cut off this negative prefix.
			if (cur < 0) {
				cur = 0;
				start = i+1;
			}
		}

		return bounds;
	}
}