#B4202. Determine Page Position in Open Book

    ID: 11859 Type: Default 1000ms 256MiB

Determine Page Position in Open Book

Determine Page Position in Open Book

A book has its pages numbered consecutively from \(1\) to \(n\). When the book is opened on the table, two side-by-side pages are visible. You are given the page numbers of these two pages, which represent the left and right pages as they currently appear on the table. Note that the pages are consecutive, but the orientation (which page is on the left and which is on the right) depends on the current open spread.

Observation:
Let the two visible pages be \(L\) and \(R\) respectively. Since the pages are consecutive, one of them is even and the other is odd. We determine the orientation of the book based on \(L\), the page on the left. Specifically:

  • If \(L\) is even, then all even-numbered pages appear on the left and all odd-numbered pages appear on the right.
  • If \(L\) is odd, then all odd-numbered pages appear on the left and all even-numbered pages appear on the right.

Given a page number \(A\), your task is to determine if page \(A\) will appear on the left side or on the right side when turned to.

Input Format: See below.

inputFormat

The input consists of two lines:

  1. The first line contains two space-separated integers: \(L\) and \(R\), the page numbers currently on the left and right sides of the open book.
  2. The second line contains a single integer \(A\), the page number to be checked.

It is guaranteed that \(L\) and \(R\) are consecutive, and that \(L\) is the left page as it appears on the table.

outputFormat

Output a single character: "L" if page \(A\) appears on the left side or "R" if page \(A\) appears on the right side.

sample

2 3
2
L