import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main {
    static Main.MyScanner sc = new Main.MyScanner();
    // static Main.Parser sc = new Parser(System.in);
    static PrintWriter out = new PrintWriter(System.out, true);

    public static void main(String[] args) throws Exception {
        int n = sc.nextInt(),s = -1,t = -1;
        String arr = "."+sc.next()+".";
        n = arr.length();
        for(int i = 0 ; i < n ; i++){
            if(arr.charAt(i) == 'L' && s == -1 )
                break;
            if( arr.charAt(i) == 'L'){
                t = i-1;
                break;
            }
            if(arr.charAt(i) == '.' && s != -1){
                t = i+1;
                break;
            }
            if(arr.charAt(i) == 'R' && s == -1){
                s = i;
            }
        }
        if(s == -1){
            for(int i = n-1 ; i >= 0 ; i--){
                if(arr.charAt(i) == 'L' && s == -1){
                    s = i;
                }
                if(arr.charAt(i) == '.' && s != -1){
                    t = i-1;
                    break;
                }
            }
        }
        out.print(s+" "+t);
        out.close();
    }

    static private class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public int mod(long x) {
            return (int) x % 1000000007;
        }

        public int mod(int x) {
            return x % 1000000007;
        }

        boolean hasNext() {
            if (st.hasMoreElements())
                return true;
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
            return st.hasMoreTokens();
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

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

    static class Parser {
        final private int BUFFER_SIZE = 65536; // 2^16, a good compromise for
                                                // some problems
        private InputStream din; // Underlying input stream
        private byte[] buffer; // Self-maintained buffer
        private int bufferPointer; // Current read position in the buffer
        private int bytesRead; // Effective bytes in the buffer read from the
                                // input stream

        public Parser(InputStream in) {
            din = in;
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        /**
         * Read the next integer from the input stream.
         *
         * @return The next integer.
         * @throws IOException
         */
        public int nextInt() throws IOException {
            int result = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            while (c >= '0' && c <= '9') {
                result = result * 10 + c - '0';
                c = read();
            }
            if (neg)
                return -result;
            return result;
        }

        /**
         * Read the next byte of data from the input stream.
         *
         * @return the next byte of data, or -1 if the end of the stream is
         *         reached.
         * @throws IOException
         *             if an I/O error occurs.
         */
        public byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        /**
         * Read data from the input stream into the buffer
         *
         * @throws IOException
         *             if an I/O error occurs.
         */
        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main {
    static Main.MyScanner sc = new Main.MyScanner();
    // static Main.Parser sc = new Parser(System.in);
    static PrintWriter out = new PrintWriter(System.out, true);

    public static void main(String[] args) throws Exception {
    	int n = sc.nextInt(),s = -1,t = -1;
    	String arr = "."+sc.next()+".";
    	n = arr.length();
    	if(arr.contains("R")){
    		for(int i = 0 ; i < n ; i++){
    			if(s == -1 && arr.charAt(i) == 'R')
    				s = i;
    			if(s != -1 && arr.charAt(i) != 'R'){
    				if(arr.charAt(i) == 'L')
    					t = i-1;
    				else
    					t = i;
    				break;
    			}
    		}
    	}else{
    		for(int i = n-1 ; i >= 0 ; i--){
    			if(arr.charAt(i) == 'L' && s == -1){
    				s = i;
    			}
    			if(s != -1 && arr.charAt(i) != 'L'){
    				t = i;break;
    			}
    		}
    	}
    	out.print(s+" "+t);
        out.close();
    }

	static private class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public int mod(long x) {
            return (int) x % 1000000007;
        }

        public int mod(int x) {
            return x % 1000000007;
        }

        boolean hasNext() {
            if (st.hasMoreElements())
                return true;
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
            return st.hasMoreTokens();
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

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

    static class Parser {
        final private int BUFFER_SIZE = 65536; // 2^16, a good compromise for
                                                // some problems
        private InputStream din; // Underlying input stream
        private byte[] buffer; // Self-maintained buffer
        private int bufferPointer; // Current read position in the buffer
        private int bytesRead; // Effective bytes in the buffer read from the
                                // input stream

        public Parser(InputStream in) {
            din = in;
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        /**
         * Read the next integer from the input stream.
         *
         * @return The next integer.
         * @throws IOException
         */
        public int nextInt() throws IOException {
            int result = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            while (c >= '0' && c <= '9') {
                result = result * 10 + c - '0';
                c = read();
            }
            if (neg)
                return -result;
            return result;
        }

        /**
         * Read the next byte of data from the input stream.
         *
         * @return the next byte of data, or -1 if the end of the stream is
         *         reached.
         * @throws IOException
         *             if an I/O error occurs.
         */
        public byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        /**
         * Read data from the input stream into the buffer
         *
         * @throws IOException
         *             if an I/O error occurs.
         */
        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }
    }
}


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

import static java.lang.Math.*;

public class FootPrints implements Runnable
{
    static class InputReader
    {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        public InputReader(InputStream stream)
        {
            this.stream = stream;
        }

        public int read()
        {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars)
            {
                curChar = 0;
                try
                {
                    numChars = stream.read(buf);
                }
                catch (IOException e)
                {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt()
        {
            int c = read();

            while(isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-')
            {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do
            {
                if(c<'0'||c>'9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
                return res * sgn;
        }

        public double nextDouble()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.')
            {
                c = read();
                double m = 1;
                while (!isSpaceChar(c))
                {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do
            {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));

            return res.toString();
        }

        public boolean isSpaceChar(int c)
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next()
        {
            return readString();
        }

        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }

	// if modulo is required set value accordingly
	public static long[][] matrixMultiply2dL(long t[][],long m[][])
	{
		long res[][]= new long[t.length][m[0].length];

		for(int i=0;i<t.length;i++)
		{
			for(int j=0;j<m[0].length;j++)
			{
				res[i][j]=0;
				for(int k=0;k<t[0].length;k++)
				{
					res[i][j]+=t[i][k]+m[k][j];
				}
			}
		}

		return res;
	}

	static long combination(long n,long r)
	{
		long ans=1;
		for(long i=0;i<r;i++)
		{
			ans=(ans*(n-i))/(i+1);
		}
		return ans;
	}

    public static void main(String args[]) throws Exception
    {
        new Thread(null, new FootPrints(),"FootPrints",1<<27).start();
    }
	// **just change the name of class from Main to reuquired**
    public void run()
    {
        InputReader sc = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);

		int n=sc.nextInt();
		char ch[]=sc.next().toCharArray();

		boolean allLeft=true,allRight=true;
		for(int i=0;i<n;++i)
		{
			if(ch[i]=='L') allRight=false;
			else if(ch[i]=='R') allLeft=false;
		}

		//System.out.println("allLeft:"+allLeft+" allRight:"+allRight);
		int s=-1,t=-1;
		if(allRight)
		{
			for(int i=n-1;i>0;--i)
			{
				if(ch[i-1]=='R')
				{
					t=i+1;
					break;
				}
			}

			for(int i=0;i<n;++i)
			{
				if(ch[i]=='R')
				{
					s=i+1;
					break;
				}
			}
			System.out.println(s+" "+t);
		}
		else if(allLeft)
		{
			for(int i=0;i<n;++i)
			{
				if(ch[i]=='L')
				{
					t=i;
					break;
				}
			}

			for(int i=n-1;i>0;--i)
			{
				if(ch[i-1]=='L')
				{
					s=i;
					break;
				}
			}

			System.out.println(s+" "+t);
		}
		else
		{
			for(int i=0;i<n;++i)
			{
				if(ch[i]=='R')
				{
					s=i+1;
					break;
				}
			}

			for(int i=0;i<n;++i)
			{
				if(ch[i]=='R' && ch[i+1]=='L')
				{
					t=i+1;
					break;
				}
			}

			System.out.println(s+" "+t);
		}

        System.out.flush();
        w.close();
    }
}


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

import static java.lang.Math.*;

public class FootPrints implements Runnable
{
    static class InputReader
    {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        public InputReader(InputStream stream)
        {
            this.stream = stream;
        }

        public int read()
        {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars)
            {
                curChar = 0;
                try
                {
                    numChars = stream.read(buf);
                }
                catch (IOException e)
                {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt()
        {
            int c = read();

            while(isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-')
            {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do
            {
                if(c<'0'||c>'9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
                return res * sgn;
        }

        public double nextDouble()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.')
            {
                c = read();
                double m = 1;
                while (!isSpaceChar(c))
                {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do
            {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));

            return res.toString();
        }

        public boolean isSpaceChar(int c)
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next()
        {
            return readString();
        }

        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }

	// if modulo is required set value accordingly
	public static long[][] matrixMultiply2dL(long t[][],long m[][])
	{
		long res[][]= new long[t.length][m[0].length];

		for(int i=0;i<t.length;i++)
		{
			for(int j=0;j<m[0].length;j++)
			{
				res[i][j]=0;
				for(int k=0;k<t[0].length;k++)
				{
					res[i][j]+=t[i][k]+m[k][j];
				}
			}
		}

		return res;
	}

	static long combination(long n,long r)
	{
		long ans=1;
		for(long i=0;i<r;i++)
		{
			ans=(ans*(n-i))/(i+1);
		}
		return ans;
	}

    public static void main(String args[]) throws Exception
    {
        new Thread(null, new FootPrints(),"FootPrints",1<<27).start();
    }
	// **just change the name of class from Main to reuquired**
    public void run()
    {
        InputReader sc = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);

		int n=sc.nextInt();
		char ch[]=sc.next().toCharArray();

		boolean allLeft=true,allRight=true;
		for(int i=0;i<n;++i)
		{
			if(ch[i]=='L') allRight=false;
			else if(ch[i]=='R') allLeft=false;
		}

		//System.out.println("allLeft:"+allLeft+" allRight:"+allRight);
		int s=-1,t=-1;
		if(allRight)
		{
			for(int i=n-1;i>0;--i)
			{
				if(ch[i-1]=='R')
				{
					t=i+1;
					break;
				}
			}

			for(int i=0;i<n;++i)
			{
				if(ch[i]=='R')
				{
					s=i;
					break;
				}
			}
			System.out.println(s+" "+t);
		}
		else if(allLeft)
		{
			for(int i=0;i<n;++i)
			{
				if(ch[i]=='L')
				{
					t=i;
					break;
				}
			}

			for(int i=n-1;i>0;--i)
			{
				if(ch[i-1]=='L')
				{
					s=i;
					break;
				}
			}

			System.out.println(s+" "+t);
		}
		else
		{
			for(int i=0;i<n;++i)
			{
				if(ch[i]=='R')
				{
					s=i+1;
					break;
				}
			}

			for(int i=0;i<n;++i)
			{
				if(ch[i]=='R' && ch[i+1]=='L')
				{
					t=i+1;
					break;
				}
			}

			System.out.println(s+" "+t);
		}

        System.out.flush();
        w.close();
    }
}


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

import static java.lang.Math.*;

public class FootPrints implements Runnable
{
    static class InputReader
    {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        public InputReader(InputStream stream)
        {
            this.stream = stream;
        }

        public int read()
        {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars)
            {
                curChar = 0;
                try
                {
                    numChars = stream.read(buf);
                }
                catch (IOException e)
                {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt()
        {
            int c = read();

            while(isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-')
            {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do
            {
                if(c<'0'||c>'9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
                return res * sgn;
        }

        public double nextDouble()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.')
            {
                c = read();
                double m = 1;
                while (!isSpaceChar(c))
                {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do
            {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));

            return res.toString();
        }

        public boolean isSpaceChar(int c)
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next()
        {
            return readString();
        }

        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }

	// if modulo is required set value accordingly
	public static long[][] matrixMultiply2dL(long t[][],long m[][])
	{
		long res[][]= new long[t.length][m[0].length];

		for(int i=0;i<t.length;i++)
		{
			for(int j=0;j<m[0].length;j++)
			{
				res[i][j]=0;
				for(int k=0;k<t[0].length;k++)
				{
					res[i][j]+=t[i][k]+m[k][j];
				}
			}
		}

		return res;
	}

	static long combination(long n,long r)
	{
		long ans=1;
		for(long i=0;i<r;i++)
		{
			ans=(ans*(n-i))/(i+1);
		}
		return ans;
	}

    public static void main(String args[]) throws Exception
    {
        new Thread(null, new FootPrints(),"FootPrints",1<<27).start();
    }
	// **just change the name of class from Main to reuquired**
    public void run()
    {
        InputReader sc = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);

		int n=sc.nextInt();
		char ch[]=sc.next().toCharArray();

		boolean allLeft=true,allRight=true;
		for(int i=0;i<n;++i)
		{
			if(ch[i]=='L') allRight=false;
			else allLeft=false;
		}

		int s=-1,t=-1;
		if(allRight)
		{
			for(int i=n-1;i>0;--i)
			{
				if(ch[i-1]=='R')
				{
					t=i;
					break;
				}
			}

			for(int i=0;i<n;++i)
			{
				if(ch[i]=='R')
				{
					s=i;
					break;
				}
			}
			System.out.println(s+" "+t);
		}
		else if(allLeft)
		{
			for(int i=0;i<n;++i)
			{
				if(ch[i]=='L')
				{
					t=i;
					break;
				}
			}

			for(int i=n-1;i>0;--i)
			{
				if(ch[i-1]=='L')
				{
					s=i;
					break;
				}
			}

			System.out.println(s+" "+t);
		}
		else
		{
			for(int i=0;i<n;++i)
			{
				if(ch[i]=='R')
				{
					s=i+1;
					break;
				}
			}

			for(int i=0;i<n;++i)
			{
				if(ch[i]=='R' && ch[i+1]=='L')
				{
					t=i+1;
					break;
				}
			}

			System.out.println(s+" "+t);
		}

        System.out.flush();
        w.close();
    }
}


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

import static java.lang.Math.*;

public class FootPrints implements Runnable
{
    static class InputReader
    {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        public InputReader(InputStream stream)
        {
            this.stream = stream;
        }

        public int read()
        {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars)
            {
                curChar = 0;
                try
                {
                    numChars = stream.read(buf);
                }
                catch (IOException e)
                {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt()
        {
            int c = read();

            while(isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-')
            {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do
            {
                if(c<'0'||c>'9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
                return res * sgn;
        }

        public double nextDouble()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.')
            {
                c = read();
                double m = 1;
                while (!isSpaceChar(c))
                {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do
            {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));

            return res.toString();
        }

        public boolean isSpaceChar(int c)
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next()
        {
            return readString();
        }

        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }

	// if modulo is required set value accordingly
	public static long[][] matrixMultiply2dL(long t[][],long m[][])
	{
		long res[][]= new long[t.length][m[0].length];

		for(int i=0;i<t.length;i++)
		{
			for(int j=0;j<m[0].length;j++)
			{
				res[i][j]=0;
				for(int k=0;k<t[0].length;k++)
				{
					res[i][j]+=t[i][k]+m[k][j];
				}
			}
		}

		return res;
	}

	static long combination(long n,long r)
	{
		long ans=1;
		for(long i=0;i<r;i++)
		{
			ans=(ans*(n-i))/(i+1);
		}
		return ans;
	}

    public static void main(String args[]) throws Exception
    {
        new Thread(null, new FootPrints(),"FootPrints",1<<27).start();
    }
	// **just change the name of class from Main to reuquired**
    public void run()
    {
        InputReader sc = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);

		int n=sc.nextInt();
		char ch[]=sc.next().toCharArray();

		boolean allLeft=true,allRight=true;
		for(int i=0;i<n;++i)
		{
			if(ch[i]=='L') allRight=false;
			else if(ch[i]=='R') allLeft=false;
		}

		//System.out.println("allLeft:"+allLeft+" allRight:"+allRight);
		int s=-1,t=-1;
		if(allRight)
		{
			for(int i=n-1;i>0;--i)
			{
				if(ch[i-1]=='R')
				{
					t=i;
					break;
				}
			}

			for(int i=0;i<n;++i)
			{
				if(ch[i]=='R')
				{
					s=i;
					break;
				}
			}
			System.out.println(s+" "+t);
		}
		else if(allLeft)
		{
			for(int i=0;i<n;++i)
			{
				if(ch[i]=='L')
				{
					t=i;
					break;
				}
			}

			for(int i=n-1;i>0;--i)
			{
				if(ch[i-1]=='L')
				{
					s=i;
					break;
				}
			}

			System.out.println(s+" "+t);
		}
		else
		{
			for(int i=0;i<n;++i)
			{
				if(ch[i]=='R')
				{
					s=i+1;
					break;
				}
			}

			for(int i=0;i<n;++i)
			{
				if(ch[i]=='R' && ch[i+1]=='L')
				{
					t=i+1;
					break;
				}
			}

			System.out.println(s+" "+t);
		}

        System.out.flush();
        w.close();
    }
}


import java.util.*;
public class Snow_Footprints
{
    public static void main(String args[])
    {
        Scanner s1 = new Scanner(System.in);
        int n = s1.nextInt();
        String s = s1.next();
        int rf = -1, lf = -1, rl = -1, ll = -1;
        for(int i=0;i<s.length();i++)
            if(s.charAt(i) == 'R')
            {
                rl = i+1;
                if(rf == -1)
                    rf = i+1;
            }
            else if(s.charAt(i) == 'L')
            {
                ll = i+1;
                if(lf == -1)
                    lf = i+1;
            }
        if(rf == -1)
            System.out.println(ll+" "+(lf-1));
        else if(lf == -1)
            System.out.println(rf+" "+(rl+1));
        else
            System.out.println(rf+" "+(lf-1));
        s1.close();
    }
}


import java.util.*;
public class Snow_Footprints
{
    public static void main(String args[])
    {
        Scanner s1 = new Scanner(System.in);
        int n = s1.nextInt();
        String s = s1.next();
        int r = -1, l = -1;
        for(int i=0;i<s.length();i++)
            if(s.charAt(i) == 'R' && r == -1)
                r = i+1;
            else if(s.charAt(i) == 'L' && l == -1)
                l = i+1;
        if(r == -1)
            System.out.println(l+" "+(l-1));
        else if(l == -1)
            System.out.println(r+" "+(r+1));
        else
            System.out.println(r+" "+(l-1));
        s1.close();
    }
}


import java.util.Scanner;

public class SnowFootprints {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		String s = input.next();
        int i = s.indexOf('R');
        int j =i;
        while(j< n && s.charAt(j)=='R')j++;
        if(i!=-1)System.out.println((i+1) + " " + (j));
        else{
        	 i = s.indexOf('L');
        	System.out.println((i+1) + " "+ (i+1));
        }
	}

}


import java.util.Scanner;

public class SnowFootprints {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		String line = input.next();
        int s = 1;
        int l = 0;
        while(line.charAt(s)=='.'){
        	s++;
        }
        char a = line.charAt(s);
       if(a=='R'){
    	   l = s;
    	   while(line.charAt(l+1)=='R'){
    		   l++;

    	   }
    	   if(line.charAt(l+1)=='.'){
    		   l++;
    	   }
    	   System.out.println(s+1+ " " + l+1);

       }
       else{
    	   l = s;
    	   while(line.charAt(s+1)=='L')s++;
    	   System.out.println((s+1) + " " + l);
       }
	}
}


import java.util.Scanner;

public class SnowFootprints {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		String s = input.next();
        int i = s.indexOf('R');
        int j = s.indexOf('L');
        System.out.println((i+1) + " " + j);
	}

}


import java.util.Scanner;

public class SnowFootprints {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		String line = input.next();
        int s = 1;
        int l = 0;
        while(line.charAt(s)=='.'){
        	s++;
        }
        char a = line.charAt(s);
       if(a=='R'){
    	   l = s;
    	   while(line.charAt(l+1)=='R'){
    		   l++;

    	   }
    	   if(line.charAt(l+1)=='.'){
    		   l++;
    	   }
    	   System.out.println((s+1) + " " + (l+1));

       }
       else{
    	   l = s;
    	   while(line.charAt(s+1)=='L')s++;
    	   System.out.println((s+1) + " " + (l));
       }
	}
}


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

import static java.lang.Math.*;

public class CF298A_SnowFootprints extends PrintWriter {
    public void solve() throws IOException {
        int n = readInt();
        String str = read();

        boolean startedTrail = false;
        int s = 0;
        int t = 0;
        for (int i = 0; i < n; i++) {
            char cur = str.charAt(i);

            if (cur == '.') {
                if (startedTrail) {
                    if (t == 0)
                        t = i + 1;
                    if (s == 0)
                        s = t;
                    break;
                }
            } else { // Not .
                if (!startedTrail) {
                    startedTrail = true;
                }

                if (cur == 'R') {
                    s = i + 1;
                } else { // L
                    if (t == 0)
                        t = i;
                    break;
                }
            }
        }

        println(s + " " + t);
    }

    BufferedReader in;
    StringTokenizer stok;

    public void run() {
        try {
            solve();
            close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(abs(-1));
        }
    }

    CF298A_SnowFootprints() {
        super(System.out);
        in = new BufferedReader(new InputStreamReader(System.in));
    }

    public static void main(String[] args) {
        try {
            Locale.setDefault(Locale.US);
        } catch (Exception ignored) {
        }
        new CF298A_SnowFootprints().run();
    }

    String read() throws IOException {
        while (stok == null || !stok.hasMoreTokens()) {
            String s = in.readLine();
            if (s == null) {
                return null;
            }
            stok = new StringTokenizer(s);
        }
        return stok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(read());
    }

    long readLong() throws IOException {
        return Long.parseLong(read());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(read());
    }

    int[] readIntArray(int len) throws IOException {
        int[] a = new int[len];
        for (int i = 0; i < len; i++) {
            a[i] = readInt();
        }
        return a;
    }

    <T> List<T>[] createAdjacencyList(int countVertex) {
        List<T>[] res = new List[countVertex];
        for (int i = 0; i < countVertex; i++) {
            res[i] = new ArrayList<T>();
        }
        return res;
    }
}


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

import static java.lang.Math.*;

public class CF298A_SnowFootprints extends PrintWriter {
    public void solve() throws IOException {
        int n = readInt();
        String str = read();

        int s = 0;
        int t = 0;
        for (int i = 0; i < n; i++) {
            char cur = str.charAt(i);
            if (cur == 'R') {
                s = i + 1;
            } else if (cur == 'L') {
                s = i + 1;

                if (t == 0)
                    t = i + 1;
            }
        }

        t = t == 0 ? s + 1: t;

        println(s + " " + t);
    }

    BufferedReader in;
    StringTokenizer stok;

    public void run() {
        try {
            solve();
            close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(abs(-1));
        }
    }

    CF298A_SnowFootprints() {
        super(System.out);
        in = new BufferedReader(new InputStreamReader(System.in));
    }

    public static void main(String[] args) {
        try {
            Locale.setDefault(Locale.US);
        } catch (Exception ignored) {
        }
        new CF298A_SnowFootprints().run();
    }

    String read() throws IOException {
        while (stok == null || !stok.hasMoreTokens()) {
            String s = in.readLine();
            if (s == null) {
                return null;
            }
            stok = new StringTokenizer(s);
        }
        return stok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(read());
    }

    long readLong() throws IOException {
        return Long.parseLong(read());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(read());
    }

    int[] readIntArray(int len) throws IOException {
        int[] a = new int[len];
        for (int i = 0; i < len; i++) {
            a[i] = readInt();
        }
        return a;
    }

    <T> List<T>[] createAdjacencyList(int countVertex) {
        List<T>[] res = new List[countVertex];
        for (int i = 0; i < countVertex; i++) {
            res[i] = new ArrayList<T>();
        }
        return res;
    }
}


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

import static java.lang.Math.*;

public class CF298A_SnowFootprints extends PrintWriter {
    public void solve() throws IOException {
        int n = readInt();
        String str = read();

        int s = 0;
        int t = 0;
        for (int i = 0; i < n; i++) {
            char cur = str.charAt(i);
            if (cur == 'R') {
                s = i + 1;
            } else if (cur == 'L') {
                s = i + 1;

                if (t == 0)
                    t = i;
            }
        }

        t = t == 0 ? s + 1: t;

        println(s + " " + t);
    }

    BufferedReader in;
    StringTokenizer stok;

    public void run() {
        try {
            solve();
            close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(abs(-1));
        }
    }

    CF298A_SnowFootprints() {
        super(System.out);
        in = new BufferedReader(new InputStreamReader(System.in));
    }

    public static void main(String[] args) {
        try {
            Locale.setDefault(Locale.US);
        } catch (Exception ignored) {
        }
        new CF298A_SnowFootprints().run();
    }

    String read() throws IOException {
        while (stok == null || !stok.hasMoreTokens()) {
            String s = in.readLine();
            if (s == null) {
                return null;
            }
            stok = new StringTokenizer(s);
        }
        return stok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(read());
    }

    long readLong() throws IOException {
        return Long.parseLong(read());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(read());
    }

    int[] readIntArray(int len) throws IOException {
        int[] a = new int[len];
        for (int i = 0; i < len; i++) {
            a[i] = readInt();
        }
        return a;
    }

    <T> List<T>[] createAdjacencyList(int countVertex) {
        List<T>[] res = new List[countVertex];
        for (int i = 0; i < countVertex; i++) {
            res[i] = new ArrayList<T>();
        }
        return res;
    }
}


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

import static java.lang.Math.*;

public class CF298A_SnowFootprints extends PrintWriter {
    public void solve() throws IOException {
        int n = readInt();
        String str = read();

        boolean startedTrail = false;
        int s = 0;
        int t = 0;
        for (int i = 0; i < n; i++) {
            char cur = str.charAt(i);

            if (cur == '.') {
                if (startedTrail) {
                    if (t == 0)
                        t = i;
                    break;
                }
            } else { // Not .
                if (!startedTrail) {
                    startedTrail = true;
                }

                if (cur == 'R') {
                    s = i + 1;
                } else { // L
                    if (t == 0)
                        t = i;
                    break;
                }
            }
        }

        println(s + " " + t);
    }

    BufferedReader in;
    StringTokenizer stok;

    public void run() {
        try {
            solve();
            close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(abs(-1));
        }
    }

    CF298A_SnowFootprints() {
        super(System.out);
        in = new BufferedReader(new InputStreamReader(System.in));
    }

    public static void main(String[] args) {
        try {
            Locale.setDefault(Locale.US);
        } catch (Exception ignored) {
        }
        new CF298A_SnowFootprints().run();
    }

    String read() throws IOException {
        while (stok == null || !stok.hasMoreTokens()) {
            String s = in.readLine();
            if (s == null) {
                return null;
            }
            stok = new StringTokenizer(s);
        }
        return stok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(read());
    }

    long readLong() throws IOException {
        return Long.parseLong(read());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(read());
    }

    int[] readIntArray(int len) throws IOException {
        int[] a = new int[len];
        for (int i = 0; i < len; i++) {
            a[i] = readInt();
        }
        return a;
    }

    <T> List<T>[] createAdjacencyList(int countVertex) {
        List<T>[] res = new List[countVertex];
        for (int i = 0; i < countVertex; i++) {
            res[i] = new ArrayList<T>();
        }
        return res;
    }
}


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

import static java.lang.Math.*;

public class CF298A_SnowFootprints extends PrintWriter {
    public void solve() throws IOException {
        int n = readInt();
        String str = read();

        int s = 0;
        int t = 0;
        for (int i = 0; i < n; i++) {
            char cur = str.charAt(i);
            if (cur == 'R') {
                s = i + 1;
            } else if (cur == 'L') {
                s = i + 1;

                if (t == 0)
                    t = i + 1;
            }
        }

        t = t == 0 ? s : t;

        println(s + " " + t);
    }

    BufferedReader in;
    StringTokenizer stok;

    public void run() {
        try {
            solve();
            close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(abs(-1));
        }
    }

    CF298A_SnowFootprints() {
        super(System.out);
        in = new BufferedReader(new InputStreamReader(System.in));
    }

    public static void main(String[] args) {
        try {
            Locale.setDefault(Locale.US);
        } catch (Exception ignored) {
        }
        new CF298A_SnowFootprints().run();
    }

    String read() throws IOException {
        while (stok == null || !stok.hasMoreTokens()) {
            String s = in.readLine();
            if (s == null) {
                return null;
            }
            stok = new StringTokenizer(s);
        }
        return stok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(read());
    }

    long readLong() throws IOException {
        return Long.parseLong(read());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(read());
    }

    int[] readIntArray(int len) throws IOException {
        int[] a = new int[len];
        for (int i = 0; i < len; i++) {
            a[i] = readInt();
        }
        return a;
    }

    <T> List<T>[] createAdjacencyList(int countVertex) {
        List<T>[] res = new List[countVertex];
        for (int i = 0; i < countVertex; i++) {
            res[i] = new ArrayList<T>();
        }
        return res;
    }
}


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

import static java.lang.Math.*;

public class CF298A_SnowFootprints extends PrintWriter {
    public void solve() throws IOException {
        int n = readInt();
        String str = read();

        boolean startedTrail = false;
        int s = 0;
        int t = 0;
        for (int i = 0; i < n; i++) {
            char cur = str.charAt(i);

            if (cur == '.') {
                if (startedTrail) {
                    if (t == 0)
                        t = i + 1;
                    if (s == 0)
                        s = i + 1;
                    break;
                }
            } else { // Not .
                if (!startedTrail) {
                    startedTrail = true;
                }

                if (cur == 'R') {
                    s = i + 1;
                } else { // L
                    if (t == 0)
                        t = i;
                    break;
                }
            }
        }

        println(s + " " + t);
    }

    BufferedReader in;
    StringTokenizer stok;

    public void run() {
        try {
            solve();
            close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(abs(-1));
        }
    }

    CF298A_SnowFootprints() {
        super(System.out);
        in = new BufferedReader(new InputStreamReader(System.in));
    }

    public static void main(String[] args) {
        try {
            Locale.setDefault(Locale.US);
        } catch (Exception ignored) {
        }
        new CF298A_SnowFootprints().run();
    }

    String read() throws IOException {
        while (stok == null || !stok.hasMoreTokens()) {
            String s = in.readLine();
            if (s == null) {
                return null;
            }
            stok = new StringTokenizer(s);
        }
        return stok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(read());
    }

    long readLong() throws IOException {
        return Long.parseLong(read());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(read());
    }

    int[] readIntArray(int len) throws IOException {
        int[] a = new int[len];
        for (int i = 0; i < len; i++) {
            a[i] = readInt();
        }
        return a;
    }

    <T> List<T>[] createAdjacencyList(int countVertex) {
        List<T>[] res = new List[countVertex];
        for (int i = 0; i < countVertex; i++) {
            res[i] = new ArrayList<T>();
        }
        return res;
    }
}


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

public class SnowFootprints {

    public static void main(String[] args) {
FastReader sc=new FastReader();
    int n=sc.nextInt();
    String f=sc.nextLine();
    int i=0;
while(f.charAt(i)=='.'){
i++;
}
 int s=i+1;
 while(f.charAt(i)!='.'){
 i++;
 }
if(f.charAt(s-1)=='R'){
if(f.charAt(i-1)=='R'){
    System.out.println(s+" "+(i+1));
}else{
    System.out.println(s+" "+f.indexOf("L"));
}

}else{
    System.out.println(s+" "+(s-1));
}

    }

}

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

}

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 str="";
    try{
        str=br.readLine();
    }
    catch(IOException e)
    {
        e.printStackTrace();
    }
    return str;
}
}


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

public class SnowFootprints {

    public static void main(String[] args) {
FastReader sc=new FastReader();
    int n=sc.nextInt();
    String f=sc.nextLine();
    int i=0;
while(f.charAt(i)=='.'){
i++;
}
 int s=i+1;
 while(f.charAt(i)!='.'){
 i++;
 }
if(f.charAt(s-1)=='R'){
if(f.charAt(i-1)=='R'){
    System.out.println(s+" "+i+1);
}else{
    System.out.println(s+" "+f.indexOf("L"));
}

}else{
    System.out.println(s+" "+(s-1));
}

    }

}

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

}

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 str="";
    try{
        str=br.readLine();
    }
    catch(IOException e)
    {
        e.printStackTrace();
    }
    return str;
}
}


import java.util.Scanner;

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

	    int n;
	    String s;

	    n = Integer.parseInt(input.nextLine());
	    s = input.nextLine();

	    for (int i = 0; i < n; ++i)
	    {
	        if (s.charAt(i) != '.')
	        {
	            if (s.charAt(i) == 'R')
	            {
	                while (s.charAt(i) == 'R')
	                {
	                    ++i;
	                }
	                System.out.println(i + " " + i+1);
	            }
	            else
	            {
	                System.out.println(i+1 + " " + i);
	            }
	            break;
	        }
	    }
	}
}


import java.util.Scanner;

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

	    int n;
	    String s;

	    n = Integer.parseInt(input.nextLine());
	    s = input.nextLine();

	    for (int i = 0; i < n; ++i)
	    {
	        if (s.charAt(i) != '.')
	        {
	            if (s.charAt(i) == 'R')
	            {
	                while (s.charAt(i) == 'R')
	                {
	                    ++i;
	                }
	                System.out.println(i + " " + (i+1));
	            }
	            else
	            {
	                System.out.println((i+1) + " " + i);
	            }
	            break;
	        }
	    }
	}
}


import java.util.Scanner;

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

		int n = Integer.parseInt(input.nextLine());

		String str = input.nextLine();

		int start = 0, end = 0;
		boolean startFlage = true;
		int counterR = 0, counterL = 0;
		char charStart = 'R';

		for(int i = 0; i < n; i++)
		{
			if(str.charAt(i) == 'R')
				counterR++;
			if(str.charAt(i) != 'L')
				counterL++;
		}

		if(counterL == 0)
		{
			for(int i = 0; i < n; i++)
			{
				if(startFlage)
				{
					if(str.charAt(i) == 'R')
					{
						start = i+1;
						charStart = 'R';
						startFlage = false;
					}
				}
				else
				{
					if(str.charAt(i) != 'R')
					{
						end = i;
						break;
					}
				}

			}
			System.out.println(start + " " + end);
			return;
		}
		else
			if(counterR == 0)
			{
				for(int i = 0; i < n; i++)
				{
					if(startFlage)
					{
						if(str.charAt(i) == 'L')
						{
							end = i+1;
							charStart = 'L';
							startFlage = false;
						}
					}
					else
					{
						if(str.charAt(i) != 'L')
						{
							start = i;
							break;
						}
					}

				}
				System.out.println(start + " " + end);
				return;
			}

		start = 0;
		end = 0;
		startFlage = true;
		counterR = 0;
		counterL = 0;
		charStart = 'R';

		for(int i = 0; i < n; i++)
		{
			if(startFlage)
			{
				if(str.charAt(i) == 'R')
				{
					start = i+1;
					charStart = 'R';
					startFlage = false;
				}
				else
				{
					if(str.charAt(i) == 'L')
					{
						end = i+1;
						charStart = 'L';
						startFlage = false;
					}
				}
			}
			else
			{
				if(str.charAt(i) != 'R')
				{
					end = i;
//					System.out.println("i1 = " + i);
					break;
				}
//				else
//					if(str.charAt(i) != 'L' &&)
//					{
//						start = i;
//						System.out.println("i2 = " + i);
//						break;
//					}
			}

		}
		System.out.println(start + " " + end);

	}
}


import java.util.*;
import java.util.function.Consumer;
import java.awt.Desktop;
import java.io.*;
import java.math.BigInteger;
import java.net.URI;
import java.sql.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import javafx.util.Pair;

public class codeforces {

public static void main(String[] args)  {
  Scanner read = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
  int a=read.nextInt();
  char arr[]=read.next().toCharArray();
  int first=0;
  char firstc = 0;
  int last=0;
  char lastc = 0;

  for(int i=0;i<a;i++)
  {
	  if(arr[i]!='.')
	  {
		  first=i;
		  firstc=arr[i];

		  break;
	  }
  }
  for(int i=a-1;i>=0;i--)
  {
	  if(arr[i]!='.')
	  {
		  last=i;
		  lastc=arr[i];

		  break;
	  }
  }
first++;
last++;

if(firstc=='R'&&lastc=='R')
	System.out.println(first+" "+(last+1));
else if(firstc=='L'&&lastc=='L')
System.out.println(last+" "+(first-1));
else
{

	for(int i=0;i<a;i++)
	if(arr[i]=='L')
	{
		last=i;
	break;
	}
System.out.println(first+" "+(last));

}

  }

}


import java.util.*;
import java.util.function.Consumer;
import java.awt.Desktop;
import java.io.*;
import java.math.BigInteger;
import java.net.URI;
import java.sql.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import javafx.util.Pair;

public class codeforces {

public static void main(String[] args)  {
  Scanner read = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
  int a=read.nextInt();
  char arr[]=read.next().toCharArray();
  int first=0;
  char firstc = 0;
  int last=0;
  char lastc = 0;

  for(int i=0;i<a;i++)
  {
	  if(arr[i]!='.')
	  {
		  first=i;
		  firstc=arr[i];

		  break;
	  }
  }
  for(int i=a-1;i>=0;i--)
  {
	  if(arr[i]!='.')
	  {
		  last=i;
		  lastc=arr[i];

		  break;
	  }
  }
first++;
last++;

if(firstc=='R'&&lastc=='R')
	System.out.println(first+" "+last+1);
else if(firstc=='L'&&lastc=='L')
System.out.println(last+" "+(first-1));
else
{

	for(int i=0;i<a;i++)
	if(arr[i]=='L')
	{
		last=i;
	break;
	}
System.out.println(first+" "+(last));

}

  }

}


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

public class fence {
	public static void main(String[] args) throws IOException{
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(f.readLine());
		int t = Integer.parseInt(st.nextToken());
		while(t > 0) {
			t --;
			st = new StringTokenizer(f.readLine());
			int a = Integer.parseInt(st.nextToken());
			int b = Integer.parseInt(st.nextToken());
			int c = Integer.parseInt(st.nextToken());
			System.out.println(a + b + c - 1);
		}
	}
}


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

public class fence {
	public static void main(String[] args) throws IOException{
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(f.readLine());
		int t = Integer.parseInt(st.nextToken());
		while(t > 0) {
			t --;
			st = new StringTokenizer(f.readLine());
			long a = Long.parseLong(st.nextToken());
			long b = Long.parseLong(st.nextToken());
			long c = Long.parseLong(st.nextToken());
			System.out.println(a + b + c - 1);
		}
	}
}


import java.io.BufferedInputStream;
import java.io.InputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.io.IOException;
import java.util.InputMismatchException;

public class CF675DIV2A{
    public static void main(String [] args) throws IOException {
        Scan sc = new Scan();
        Print print = new Print();
        int t = sc.scanInt();
        while(t-- >0){
            long a = sc.scanLong();
            long b = sc.scanInt();
            long c = sc.scanInt();
            long d = (a+b+c)-1;
            print.println(String.valueOf(d));
        }
        print.close();

    }
}

class Scan{
    private byte[] buf=new byte[1024];
    private int index;
    private InputStream in;
    private int total;
    public Scan(){
        in=System.in;
    }
    public int scan()throws IOException
    {
        if(total<0)
        throw new InputMismatchException();
        if(index>=total)
        {
            index=0;
            total=in.read(buf);
            if(total<=0)
            return -1;
        }
        return buf[index++];
    }
    public int scanInt()throws IOException
    {
        int integer=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        int neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n))
        {
            if(n>='0'&&n<='9')
            {
                integer*=10;
                integer+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        return neg*integer;
    }

    public long scanLong()throws IOException
    {
        long integer=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        long neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n))
        {
            if(n>='0'&&n<='9')
            {
                integer*=10;
                integer+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        return neg*integer;
    }

    public double scanDouble()throws IOException
    {
        double doub=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        int neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n)&&n!='.')
        {
            if(n>='0'&&n<='9')
            {
                doub*=10;
                doub+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        if(n=='.')
        {
            n=scan();
            double temp=1;
            while(!isWhiteSpace(n))
            {
                if(n>='0'&&n<='9')
                {
                    temp/=10;
                    doub+=(n-'0')*temp;
                    n=scan();
                }
                else throw new InputMismatchException();
            }
        }
        return doub*neg;
    }

    public String scanString()throws IOException
    {
        StringBuilder sb=new StringBuilder();
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        while(!isWhiteSpace(n))
        {
            sb.append((char)n);
            n=scan();
        }
        return sb.toString();
    }
    private boolean isWhiteSpace(int n)
    {
        if(n==' '||n=='\n'||n=='\r'||n=='\t'||n==-1)
        return true;
        return false;
    }

}

class Print{
    private final BufferedWriter bw;
    public Print()
    {
        this.bw=new BufferedWriter(new OutputStreamWriter(System.out));
    }
    public void print(Object object)throws IOException
    {
        bw.append(""+object);
    }
    public void println(Object object)throws IOException
    {
        print(object);
        bw.append("\n");
    }
    public void close()throws IOException
    {
        bw.close();
    }
}


import java.io.BufferedInputStream;
import java.io.InputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.io.IOException;
import java.util.InputMismatchException;

public class CF675DIV2A{
    public static void main(String [] args) throws IOException {
        Scan sc = new Scan();
        Print print = new Print();
        int t = sc.scanInt();
        while(t-- >0){
            int a = sc.scanInt();
            int b = sc.scanInt();
            int c = sc.scanInt();
            int d = a+(long)b+c-1;
            print.println(d);
        }
        print.close();

    }
}

class Scan{
    private byte[] buf=new byte[1024];
    private int index;
    private InputStream in;
    private int total;
    public Scan(){
        in=System.in;
    }
    public int scan()throws IOException
    {
        if(total<0)
        throw new InputMismatchException();
        if(index>=total)
        {
            index=0;
            total=in.read(buf);
            if(total<=0)
            return -1;
        }
        return buf[index++];
    }
    public int scanInt()throws IOException
    {
        int integer=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        int neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n))
        {
            if(n>='0'&&n<='9')
            {
                integer*=10;
                integer+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        return neg*integer;
    }

    public long scanLong()throws IOException
    {
        long integer=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        long neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n))
        {
            if(n>='0'&&n<='9')
            {
                integer*=10;
                integer+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        return neg*integer;
    }

    public double scanDouble()throws IOException
    {
        double doub=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        int neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n)&&n!='.')
        {
            if(n>='0'&&n<='9')
            {
                doub*=10;
                doub+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        if(n=='.')
        {
            n=scan();
            double temp=1;
            while(!isWhiteSpace(n))
            {
                if(n>='0'&&n<='9')
                {
                    temp/=10;
                    doub+=(n-'0')*temp;
                    n=scan();
                }
                else throw new InputMismatchException();
            }
        }
        return doub*neg;
    }

    public String scanString()throws IOException
    {
        StringBuilder sb=new StringBuilder();
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        while(!isWhiteSpace(n))
        {
            sb.append((char)n);
            n=scan();
        }
        return sb.toString();
    }
    private boolean isWhiteSpace(int n)
    {
        if(n==' '||n=='\n'||n=='\r'||n=='\t'||n==-1)
        return true;
        return false;
    }

}

class Print{
    private final BufferedWriter bw;
    public Print()
    {
        this.bw=new BufferedWriter(new OutputStreamWriter(System.out));
    }
    public void print(Object object)throws IOException
    {
        bw.append(""+object);
    }
    public void println(Object object)throws IOException
    {
        print(object);
        bw.append("\n");
    }
    public void close()throws IOException
    {
        bw.close();
    }
}


import java.io.BufferedInputStream;
import java.io.InputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.io.IOException;
import java.util.InputMismatchException;

public class CF675DIV2A{
    public static void main(String [] args) throws IOException {
        Scan sc = new Scan();
        Print print = new Print();
        int t = sc.scanInt();
        while(t-- >0){
            int a = sc.scanInt();
            int b = sc.scanInt();
            int c = sc.scanInt();
            int d = a+b+c-1;
            print.println(d);
        }
        print.close();

    }
}

class Scan{
    private byte[] buf=new byte[1024];
    private int index;
    private InputStream in;
    private int total;
    public Scan(){
        in=System.in;
    }
    public int scan()throws IOException
    {
        if(total<0)
        throw new InputMismatchException();
        if(index>=total)
        {
            index=0;
            total=in.read(buf);
            if(total<=0)
            return -1;
        }
        return buf[index++];
    }
    public int scanInt()throws IOException
    {
        int integer=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        int neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n))
        {
            if(n>='0'&&n<='9')
            {
                integer*=10;
                integer+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        return neg*integer;
    }

    public long scanLong()throws IOException
    {
        long integer=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        long neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n))
        {
            if(n>='0'&&n<='9')
            {
                integer*=10;
                integer+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        return neg*integer;
    }

    public double scanDouble()throws IOException
    {
        double doub=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        int neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n)&&n!='.')
        {
            if(n>='0'&&n<='9')
            {
                doub*=10;
                doub+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        if(n=='.')
        {
            n=scan();
            double temp=1;
            while(!isWhiteSpace(n))
            {
                if(n>='0'&&n<='9')
                {
                    temp/=10;
                    doub+=(n-'0')*temp;
                    n=scan();
                }
                else throw new InputMismatchException();
            }
        }
        return doub*neg;
    }

    public String scanString()throws IOException
    {
        StringBuilder sb=new StringBuilder();
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        while(!isWhiteSpace(n))
        {
            sb.append((char)n);
            n=scan();
        }
        return sb.toString();
    }
    private boolean isWhiteSpace(int n)
    {
        if(n==' '||n=='\n'||n=='\r'||n=='\t'||n==-1)
        return true;
        return false;
    }

}

class Print{
    private final BufferedWriter bw;
    public Print()
    {
        this.bw=new BufferedWriter(new OutputStreamWriter(System.out));
    }
    public void print(Object object)throws IOException
    {
        bw.append(""+object);
    }
    public void println(Object object)throws IOException
    {
        print(object);
        bw.append("\n");
    }
    public void close()throws IOException
    {
        bw.close();
    }
}


import java.io.BufferedInputStream;
import java.io.InputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.io.IOException;
import java.util.InputMismatchException;

public class CF675DIV2A{
    public static void main(String [] args) throws IOException {
        Scan sc = new Scan();
        Print print = new Print();
        int t = sc.scanInt();
        while(t-- >0){
            int a = sc.scanInt();
            int b = sc.scanInt();
            int c = sc.scanInt();

            int d = (int) Math.sqrt((3*(Math.pow(a, 2) + Math.pow(b, 2) + Math.pow(c, 2))) + 1);
            print.println(d);
        }
        print.close();

    }
}

class Scan{
    private byte[] buf=new byte[1024];
    private int index;
    private InputStream in;
    private int total;
    public Scan(){
        in=System.in;
    }
    public int scan()throws IOException
    {
        if(total<0)
        throw new InputMismatchException();
        if(index>=total)
        {
            index=0;
            total=in.read(buf);
            if(total<=0)
            return -1;
        }
        return buf[index++];
    }
    public int scanInt()throws IOException
    {
        int integer=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        int neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n))
        {
            if(n>='0'&&n<='9')
            {
                integer*=10;
                integer+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        return neg*integer;
    }

    public long scanLong()throws IOException
    {
        long integer=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        long neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n))
        {
            if(n>='0'&&n<='9')
            {
                integer*=10;
                integer+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        return neg*integer;
    }

    public double scanDouble()throws IOException
    {
        double doub=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        int neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n)&&n!='.')
        {
            if(n>='0'&&n<='9')
            {
                doub*=10;
                doub+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        if(n=='.')
        {
            n=scan();
            double temp=1;
            while(!isWhiteSpace(n))
            {
                if(n>='0'&&n<='9')
                {
                    temp/=10;
                    doub+=(n-'0')*temp;
                    n=scan();
                }
                else throw new InputMismatchException();
            }
        }
        return doub*neg;
    }

    public String scanString()throws IOException
    {
        StringBuilder sb=new StringBuilder();
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        while(!isWhiteSpace(n))
        {
            sb.append((char)n);
            n=scan();
        }
        return sb.toString();
    }
    private boolean isWhiteSpace(int n)
    {
        if(n==' '||n=='\n'||n=='\r'||n=='\t'||n==-1)
        return true;
        return false;
    }

}

class Print{
    private final BufferedWriter bw;
    public Print()
    {
        this.bw=new BufferedWriter(new OutputStreamWriter(System.out));
    }
    public void print(Object object)throws IOException
    {
        bw.append(""+object);
    }
    public void println(Object object)throws IOException
    {
        print(object);
        bw.append("\n");
    }
    public void close()throws IOException
    {
        bw.close();
    }
}


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

public class Solution{

    public static void main(String[] args) throws Exception{
        int T = in.readInt();
        while(T-->0){
            int[] A = in.readA();
            System.out.println(1);
        }
    }

    static Inputer in;
    static {
        in = new Inputer();
    }

    static class Inputer{
        BufferedReader br;
        Inputer(){
            try{
                br = new BufferedReader(new InputStreamReader(System.in));
            }
            catch(Exception e){}
        }
        public int readInt() throws Exception{
            return Integer.parseInt(readLine());
        }
        public long readLong() throws Exception{
            return Long.parseLong(readLine());
        }
        public int[] readA(String delim) throws Exception{
            String[] s = readLine().split(delim);
            int[] A = new int[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Integer.parseInt(s[i]);
            return A;
        }
        public int[] readA() throws Exception{
            String[] s = readLine().split("\\s+");
            int[] A = new int[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Integer.parseInt(s[i]);
            return A;
        }
        public long[] readLA() throws Exception{
            String[] s = readLine().split("\\s+");
            long[] A = new long[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Long.parseLong(s[i]);
            return A;
        }
        public String readLine() throws Exception{
            return br.readLine();
        }
        public int[] copyA(int[] A){
            int[] B = new int[A.length];
            for(int i= 0 ; i < A.length; i++)
                B[i] = A[i];
            return B;
        }
    }
}


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

public class Solution{

    public static void main(String[] args) throws Exception{
        int T = in.readInt();
        while(T-->0){
            long[] A = in.readLA();
            long ab = A[0]+A[1], bc = A[1]+A[2], ca = A[2]+A[0];

            System.out.println(ab+bc+ca);
        }
    }

    static Inputer in;
    static {
        in = new Inputer();
    }

    static class Inputer{
        BufferedReader br;
        Inputer(){
            try{
                br = new BufferedReader(new InputStreamReader(System.in));
            }
            catch(Exception e){}
        }
        public int readInt() throws Exception{
            return Integer.parseInt(readLine());
        }
        public long readLong() throws Exception{
            return Long.parseLong(readLine());
        }
        public int[] readA(String delim) throws Exception{
            String[] s = readLine().split(delim);
            int[] A = new int[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Integer.parseInt(s[i]);
            return A;
        }
        public int[] readA() throws Exception{
            String[] s = readLine().split("\\s+");
            int[] A = new int[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Integer.parseInt(s[i]);
            return A;
        }
        public long[] readLA() throws Exception{
            String[] s = readLine().split("\\s+");
            long[] A = new long[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Long.parseLong(s[i]);
            return A;
        }
        public String readLine() throws Exception{
            return br.readLine();
        }
        public int[] copyA(int[] A){
            int[] B = new int[A.length];
            for(int i= 0 ; i < A.length; i++)
                B[i] = A[i];
            return B;
        }
    }
}


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

public class Solution{

    public static void main(String[] args) throws Exception{
        int T = in.readInt();
        while(T-->0){
            long[] A = in.readLA();

            System.out.println(A[0]+A[1]+A[2]-1);
        }
    }

    static Inputer in;
    static {
        in = new Inputer();
    }

    static class Inputer{
        BufferedReader br;
        Inputer(){
            try{
                br = new BufferedReader(new InputStreamReader(System.in));
            }
            catch(Exception e){}
        }
        public int readInt() throws Exception{
            return Integer.parseInt(readLine());
        }
        public long readLong() throws Exception{
            return Long.parseLong(readLine());
        }
        public int[] readA(String delim) throws Exception{
            String[] s = readLine().split(delim);
            int[] A = new int[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Integer.parseInt(s[i]);
            return A;
        }
        public int[] readA() throws Exception{
            String[] s = readLine().split("\\s+");
            int[] A = new int[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Integer.parseInt(s[i]);
            return A;
        }
        public long[] readLA() throws Exception{
            String[] s = readLine().split("\\s+");
            long[] A = new long[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Long.parseLong(s[i]);
            return A;
        }
        public String readLine() throws Exception{
            return br.readLine();
        }
        public int[] copyA(int[] A){
            int[] B = new int[A.length];
            for(int i= 0 ; i < A.length; i++)
                B[i] = A[i];
            return B;
        }
    }
}


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

public class Solution{

    public static void main(String[] args) throws Exception{
        int T = in.readInt();
        while(T-->0){
            int[] A = in.readA();
            int xy = A[0]+A[1], z = A[2];

            System.out.println((int)(1+Math.sqrt((xy-z)*(xy-z)+xy*xy)));
        }
    }

    static Inputer in;
    static {
        in = new Inputer();
    }

    static class Inputer{
        BufferedReader br;
        Inputer(){
            try{
                br = new BufferedReader(new InputStreamReader(System.in));
            }
            catch(Exception e){}
        }
        public int readInt() throws Exception{
            return Integer.parseInt(readLine());
        }
        public long readLong() throws Exception{
            return Long.parseLong(readLine());
        }
        public int[] readA(String delim) throws Exception{
            String[] s = readLine().split(delim);
            int[] A = new int[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Integer.parseInt(s[i]);
            return A;
        }
        public int[] readA() throws Exception{
            String[] s = readLine().split("\\s+");
            int[] A = new int[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Integer.parseInt(s[i]);
            return A;
        }
        public long[] readLA() throws Exception{
            String[] s = readLine().split("\\s+");
            long[] A = new long[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Long.parseLong(s[i]);
            return A;
        }
        public String readLine() throws Exception{
            return br.readLine();
        }
        public int[] copyA(int[] A){
            int[] B = new int[A.length];
            for(int i= 0 ; i < A.length; i++)
                B[i] = A[i];
            return B;
        }
    }
}


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

public class Solution{

    public static void main(String[] args) throws Exception{
        int T = in.readInt();
        while(T-->0){
            long[] A = in.readLA();
            long xy = A[0]+A[1], z = A[2];

            System.out.println((long)(1+Math.sqrt((xy-z)*(xy-z)+xy*xy)));
        }
    }

    static Inputer in;
    static {
        in = new Inputer();
    }

    static class Inputer{
        BufferedReader br;
        Inputer(){
            try{
                br = new BufferedReader(new InputStreamReader(System.in));
            }
            catch(Exception e){}
        }
        public int readInt() throws Exception{
            return Integer.parseInt(readLine());
        }
        public long readLong() throws Exception{
            return Long.parseLong(readLine());
        }
        public int[] readA(String delim) throws Exception{
            String[] s = readLine().split(delim);
            int[] A = new int[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Integer.parseInt(s[i]);
            return A;
        }
        public int[] readA() throws Exception{
            String[] s = readLine().split("\\s+");
            int[] A = new int[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Integer.parseInt(s[i]);
            return A;
        }
        public long[] readLA() throws Exception{
            String[] s = readLine().split("\\s+");
            long[] A = new long[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Long.parseLong(s[i]);
            return A;
        }
        public String readLine() throws Exception{
            return br.readLine();
        }
        public int[] copyA(int[] A){
            int[] B = new int[A.length];
            for(int i= 0 ; i < A.length; i++)
                B[i] = A[i];
            return B;
        }
    }
}


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

public class Solution{

    public static void main(String[] args) throws Exception{
        int T = in.readInt();
        while(T-->0){
            int[] A = in.readA();
            int xy = A[0]+A[1], z = A[2];

            System.out.println((int)(10+Math.sqrt((xy-z)*(xy-z)+xy*xy)));
        }
    }

    static Inputer in;
    static {
        in = new Inputer();
    }

    static class Inputer{
        BufferedReader br;
        Inputer(){
            try{
                br = new BufferedReader(new InputStreamReader(System.in));
            }
            catch(Exception e){}
        }
        public int readInt() throws Exception{
            return Integer.parseInt(readLine());
        }
        public long readLong() throws Exception{
            return Long.parseLong(readLine());
        }
        public int[] readA(String delim) throws Exception{
            String[] s = readLine().split(delim);
            int[] A = new int[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Integer.parseInt(s[i]);
            return A;
        }
        public int[] readA() throws Exception{
            String[] s = readLine().split("\\s+");
            int[] A = new int[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Integer.parseInt(s[i]);
            return A;
        }
        public long[] readLA() throws Exception{
            String[] s = readLine().split("\\s+");
            long[] A = new long[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Long.parseLong(s[i]);
            return A;
        }
        public String readLine() throws Exception{
            return br.readLine();
        }
        public int[] copyA(int[] A){
            int[] B = new int[A.length];
            for(int i= 0 ; i < A.length; i++)
                B[i] = A[i];
            return B;
        }
    }
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class CodeForces {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		int testCases = 0;
		List al = new ArrayList();
		List<Integer> al2 = new ArrayList();
		Scanner sc = new Scanner(System.in);
		testCases = sc.nextInt();
		for (int i = 0; i < testCases; i++) {
//			int size = sc.nextInt();
//			ArrayList n = new ArrayList();
//			int[] arr = new int[size];
//			for(int j = 0;j<size;j++) {
//				int next = sc.nextInt();
//
//				arr[j]= next;
//			}
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();

			int xa = 0, ya = 0, xb = 0, yb = b, xc = c, yc = b;
			//System.out.println(0);
			System.out.println(Math.sqrt((c*c)+(b*b)));
		}
	}

}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class CodeForces {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		int testCases = 0;
		List al = new ArrayList();
		List<Integer> al2 = new ArrayList();
		Scanner sc = new Scanner(System.in);
		testCases = sc.nextInt();
		for (int i = 0; i < testCases; i++) {
//			int size = sc.nextInt();
//			ArrayList n = new ArrayList();
//			int[] arr = new int[size];
//			for(int j = 0;j<size;j++) {
//				int next = sc.nextInt();
//
//				arr[j]= next;
//			}
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();

			int maxDiag1 = (b+c)-1;

			//System.out.println(0);
			System.out.println(maxDiag1+a-1);
		}
	}

}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class CodeForces {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		int testCases = 0;
		List al = new ArrayList();
		List<Integer> al2 = new ArrayList();
		Scanner sc = new Scanner(System.in);
		testCases = sc.nextInt();
		for (int i = 0; i < testCases; i++) {
//			int size = sc.nextInt();
//			ArrayList n = new ArrayList();
//			int[] arr = new int[size];
//			for(int j = 0;j<size;j++) {
//				int next = sc.nextInt();
//
//				arr[j]= next;
//			}
			long a = sc.nextInt();
			long b = sc.nextInt();
			long c = sc.nextInt();

			long maxDiag1 = (b+c)-1;

			//System.out.println(0);
			System.out.println(maxDiag1+a-1);
		}
	}

}


import java.util.*;

public class Test {
	public static void main(String[] args) {

		Scanner input = new Scanner(System.in);
		int t = input.nextInt();

		for (int i = 0; i < t; i++) {

			int a = input.nextInt();
			int b = input.nextInt();
			int c = input.nextInt();

			System.out.println((a - c) * b);
		}
	}
}


import java.util.*;

public class Test {
	public static void main(String[] args) {

		Scanner input = new Scanner(System.in);
		int t = input.nextInt();

		for (int i = 0; i < t; i++) {

			int a = input.nextInt();
			int b = input.nextInt();
			int c = input.nextInt();

			int max = max(a, b, c);
			System.out.println(max);
		}
	}

	public static int max(int a, int b, int c) {

		int[] arr = {a, b, c};
		int max = arr[0];

		for (int i = 1; i < 3; i++) {
			if (arr[i] > max)
				max = arr[i];
		}
		return max;
	}
}


import java.util.*;

public class Test {
	public static void main(String[] args) {

		Scanner input = new Scanner(System.in);
		int t = input.nextInt();

		for (int i = 0; i < t; i++) {

			int a = input.nextInt();
			int b = input.nextInt();
			int c = input.nextInt();

			System.out.println(Math.round((a + b + c) / 2));

		}
	}
}


import java.util.*;

public class Test {
	public static void main(String[] args) {

		Scanner input = new Scanner(System.in);
		int t = input.nextInt();

		for (int i = 0; i < t; i++) {

			int a = input.nextInt();
			int b = input.nextInt();
			int c = input.nextInt();
			int max = a + b + c;

			for (int d = 1; d < max; d++) {

				double p = (a + b + c + d) / 2;
				double s = Math.sqrt(p * (p-a) * (p-b) * (p-c) * (p-d));

				if (s > 0) {
					System.out.println(d);
					break;
				}
			}

		}
	}
}


import java.util.*;

public class Test {
	public static void main(String[] args) {

		Scanner input = new Scanner(System.in);
		int t = input.nextInt();

		for (int i = 0; i < t; i++) {

			int a = input.nextInt();
			int b = input.nextInt();
			int c = input.nextInt();

			System.out.println(Math.abs(a - c) * b);
		}
	}
}


import java.util.*;

public class Test {
	public static void main(String[] args) {

		Scanner input = new Scanner(System.in);
		int t = input.nextInt();

		for (int i = 0; i < t; i++) {

			int a = input.nextInt();
			int b = input.nextInt();
			int c = input.nextInt();
			int max = max(a, b, c);

			for (int d = 1; d < max; d++) {

				double p = (a + b + c + d) / 2;
				double s = Math.sqrt((p-a) * (p-b) * (p-c) * (p-d));

				if (s > 0) {
					System.out.println(d);
					break;
				}
			}

		}
	}

	public static int max(int a, int b, int c) {

		int[] arr = {a, b, c};
		int max = arr[0];

		for (int i = 1; i < 3; i++) {
			if (arr[i] > max) {
				max = arr[i];
			}
		}
		return max;
	}
}


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

public class Main
{
	static class FastReader
	{
		BufferedReader br;
		StringTokenizer st;

		public FastReader()
		{
			br = new BufferedReader(new
					InputStreamReader(System.in));
		}

		String next()
		{
			while (st == null || !st.hasMoreElements())
			{
				try
				{
					st = new StringTokenizer(br.readLine());
				}
				catch (IOException e)
				{
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

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

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

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

	public static void main(String[] args) throws java.lang.Exception
	{
		FastReader sc = new FastReader();
		int t = sc.nextInt();

		while(t-->0){
		    int a = sc.nextInt();
		    int b = sc.nextInt();
		    int c = sc.nextInt();

            System.out,println(Math.max(a,b,c));
		}
	}
}


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

public class Main
{
	static class FastReader
	{
		BufferedReader br;
		StringTokenizer st;

		public FastReader()
		{
			br = new BufferedReader(new
					InputStreamReader(System.in));
		}

		String next()
		{
			while (st == null || !st.hasMoreElements())
			{
				try
				{
					st = new StringTokenizer(br.readLine());
				}
				catch (IOException e)
				{
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

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

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

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

	public static void main(String[] args) throws java.lang.Exception
	{
		FastReader sc = new FastReader();
		int t = sc.nextInt();

		while(t-->0){
		    int a = sc.nextInt();
		    int b = sc.nextInt();
		    int c = sc.nextInt();

            System.out.println(Math.max(a,Math.max(b,c)));
		}
	}
}


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

public class Main
{
	static class FastReader
	{
		BufferedReader br;
		StringTokenizer st;

		public FastReader()
		{
			br = new BufferedReader(new
					InputStreamReader(System.in));
		}

		String next()
		{
			while (st == null || !st.hasMoreElements())
			{
				try
				{
					st = new StringTokenizer(br.readLine());
				}
				catch (IOException e)
				{
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

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

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

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

	public static void main(String[] args) throws java.lang.Exception
	{
		FastReader sc = new FastReader();
		int t = sc.nextInt();

		while(t-->0){
		    int a = sc.nextInt();
		    int b = sc.nextInt();
		    int c = sc.nextInt();

            System.out.println(Math.max(a,b,c));
		}
	}
}