New Year Present

题意翻译

新年伊始,人们正忙着准备新年礼物。程序员Vasily也不例外。 Vasily 知道最好的礼物(不,不是比赛)是钱。他把n个空钱包从左到右排成一行,并决定好了每个钱包打算放多少钱。 他打算放$a_i$个硬币在左数第i个钱包里。 他是个很忙的人,所以这个任务就交给了他的机器人。这个机器人初始站在最左边的钱包里。他可以执行这样三个操作: 左走一格、右走一格(均不允许越界)、在当前钱包里塞一块钱。 由于一些技术问题,这个机器人不能连续两次执行“塞钱”操作。 他不想等太久,所以他想编写一个给机器人执行的程序并使得步骤数<=$10^6$(不要求最短),并完成所有硬币的放置。. 请帮助他完成。 输入: 第一行一个整数$n ,( 2 <=n <= 300)$,表示钱包数目。接下来一行n个数,表示放的硬币数。 $0 <= a_i <= 300$ 输出: 输出一个长度不超过$10^6$的字符串,其中L代表上文中“左走一格”,R代表“右走一格” P表示放钱包。不能越界、不能连续两次做P操作。 你可以任意输出一种方案。

题目描述

The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception. Vasily knows that the best present is (no, it's not a contest) money. He's put $ n $ empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to put $ a_{i} $ coins to the $ i $ -th wallet from the left. Vasily is a very busy man, so the money are sorted into the bags by his robot. Initially, the robot stands by the leftmost wallet in the row. The robot can follow instructions of three types: go to the wallet that is to the left of the current one (if such wallet exists), go to the wallet that is to the right of the current one (if such wallet exists), put a coin to the current wallet. Due to some technical malfunctions the robot cannot follow two "put a coin" instructions in a row. Vasily doesn't want to wait for long, so he wants to write a program for the robot that contains at most $ 10^{6} $ operations (not necessarily minimum in length) the robot can use to put coins into the wallets. Help him.

输入输出格式

输入格式


The first line contains integer $ n $ $ (2<=n<=300) $ — the number of wallets. The next line contains $ n $ integers $ a_{1},a_{2},...,a_{n} $ $ (0<=a_{i}<=300) $ . It is guaranteed that at least one $ a_{i} $ is positive.

输出格式


Print the sequence that consists of $ k $ $ (1<=k<=10^{6}) $ characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot is not allowed to go beyond the wallet line. In other words, you cannot give instructions "L" if the robot is at wallet 1, or "R" at wallet $ n $ . As a result of the performed operations, the $ i $ -th wallet from the left must contain exactly $ a_{i} $ coins. If there are multiple answers, you can print any of them.

输入输出样例

输入样例 #1

2
1 2

输出样例 #1

PRPLRP

输入样例 #2

4
0 2 0 2

输出样例 #2

RPRRPLLPLRRRP