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 ai 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 106 operations (not necessarily minimum in length) the robot can use to put coins into the wallets. Help him.

Input

The first line contains integer n (2 ≤ n ≤ 300) — the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 300).

It is guaranteed that at least one ai is positive.

Output

Print the sequence that consists of k (1 ≤ k ≤ 106) 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 ai coins. If there are multiple answers, you can print any of them.

Examples

Input

2
1 2


Output

PRPLRP

Input

4
0 2 0 2


Output

RPRRPLLPLRRRP

Difficulty: EASY
Tags: Implementation

Constructive algorithms

Starter code:

Solutions:
n = int(input())
l = [int(x) for x in input().split()]
s = ''
for x in l[:-1]:
	if x:
		s += 'P'
		for i in range(x - 1):
			s += 'RLP'
	s += 'R'
if l[-1]:
	s += 'P'
	for i in range(l[-1] - 1):
		s += 'LRP'
print(s)


n = int(input())
a = input().split()
for i in range(n):
	a[i] = int(a[i])
i = 0
while i != n - 1:
	if i > 0 and a[i - 1] > 0:
		if a[i] > 0:
			print('PL', end='')
			a[i] -= 1
		else:
			print('L', end='')
		i -= 1
	elif a[i] == 0:
		print('R', end='')
		i += 1
	else:
		print('PR', end='')
		a[i] -= 1
		i += 1
while a[i] > 0 or a[i - 1] > 0:
	if a[i] > 0:
		a[i] -= 1
		print('P', end='')
	if a[i - 1] > 0:
		a[i - 1] -= 1
		print('LPR', end='')
	else:
		print('LR', end='')


n = int(input())
s = list(map(int, input().split()))
x = ''
for i in range(n - 1):
	while s[i] > 0:
		x = x + 'PRL'
		s[i] -= 1
	x = x + 'R'
while s[n - 1] > 0:
	s[n - 1] -= 1
	x = x + 'PLR'
print(x)


num = int(input())
arr = list(map(int, input().split()))
for i in range(num):
	if i != num - 1:
		print('PRL' * arr[i], end='')
	else:
		print('PLR' * arr[i])
	if i != num - 1:
		print('R', end='')


n = int(input())
a = list(map(int, input().split()))
r = 'PRL' * a[0]
for i in range(1, n):
	r += 'R' + 'PLR' * a[i]
print(r)


def main():
	n = int(input())
	tab = ['']
	for (i, x) in enumerate(map(int, input().split())):
		if i != n - 1:
			for _ in range(x):
				tab.append('PRL')
			tab.append('R')
		else:
			for _ in range(x):
				tab.append('PLR')
	print(''.join(tab))
main()


n = int(input())
a = list(map(int, input().split()))
sum = 0
for i in range(n):
	sum += a[i]
p = 0
while sum != 0:
	if a[p] != 0:
		print('P', end='')
		a[p] -= 1
		sum -= 1
		if sum == 0:
			break
		elif a[p] == 0:
			continue
		if p != n - 1:
			print('R', end='')
			if a[p + 1] != 0:
				a[p + 1] -= 1
				print('P', end='')
				sum -= 1
			print('L', end='')
		else:
			print('L', end='')
			print('R', end='')
	else:
		p += 1
		print('R', end='')


n = int(input())
arr = [int(i) for i in input().split()]
for i in range(n):
	tmp = arr[i]
	while tmp > 0:
		print('P', end='')
		tmp -= 1
		if tmp:
			if i == 0:
				print('RL', end='')
			else:
				print('LR', end='')
	if i < n - 1:
		print('R', end='')


n = int(input())
string = input()
coins = list(map(int, string.split()))
s = ''
for x in range(n):
	a = coins[x]
	while a > 1:
		s += 'P'
		if x == n - 1:
			s += 'LR'
		else:
			s += 'RL'
		a -= 1
	if a == 1:
		s += 'P'
	if x < n - 1:
		s += 'R'
print(s)


n = int(input())
A = list(map(int, input().split()))
i = 0
check = False
while i < n:
	if A[i] != 0 and (not check):
		A[i] -= 1
		check = True
		print('P', end='')
	else:
		check = False
		if i == 0:
			i += 1
			print('R', end='')
		elif A[i - 1] != 0 or (i == n - 1 and A[i] != 0):
			i -= 1
			print('L', end='')
		else:
			i += 1
			if i != n:
				print('R', end='')


n = int(input())
A = list(map(int, input().split()))
i = 0
T = sum(A)
while T > 0:
	if A[i] > 0:
		print('P', end='')
		T -= 1
		A[i] -= 1
	if i > 0 and A[i - 1] > 0 or i == n - 1:
		print('L', end='')
		i -= 1
	else:
		print('R', end='')
		i += 1


n = int(input())
a = list(map(int, input().split()))
lines = []
for i in range(n - 1):
	if a[i] == 0:
		lines += ['R']
	else:
		lines += ['PRL' * (a[i] - 1) + 'PR']
if a[n - 1] > 0:
	lines += ['PLR' * (a[n - 1] - 1) + 'P']
print(''.join(lines))


n = int(input())
a = list(map(int, input().split()))
s = ('P' if a[0] > 0 else '') + 'RLP' * (a[0] - 1)
for i in range(1, n):
	s += 'R'
	s += ('P' if a[i] > 0 else '') + 'LRP' * (a[i] - 1)
print(s)


(n, a) = (input(), list(map(int, input().split())))
print('R'.join(('PRL' * i for i in a[:-1])) + 'R' + 'LRP' * a[-1])


n = int(input())
a = ''
b = list(map(int, input().split()))
a += 'PRL' * (b[0] - 1)
if b[0] != 0:
	a += 'P'
b[0] = 0
for i in range(1, n):
	a += 'R'
	a += 'PLR' * (b[i] - 1)
	if b[i] != 0:
		a += 'P'
	b[i] = 0
print(a)


input()
v = list(input().split())
print('PRL' * int(v[0]) + ''.join(('R' + int(i) * 'PLR' for i in v[1:])))


n = int(input())
a = list(map(int, input().split()))
i = 0
s = ''
r = False
while i < n:
	if a[i] > 0:
		s += 'P'
		a[i] -= 1
		if a[i] > 0:
			r = True
	if i + 1 == n and r == True:
		i = 0
		s += 'L' * (n - 1)
		r = False
	else:
		i += 1
		if i < n:
			s += 'R'
print(s)


n = int(input())
v = [int(i) for i in input().split()]
pos = 0
while pos != n - 1:
	if v[pos] != 0:
		print('P', end='')
		v[pos] -= 1
	if pos == 0:
		print('R', end='')
		pos += 1
	elif v[pos - 1] != 0:
		print('L', end='')
		pos -= 1
	else:
		print('R', end='')
		pos += 1
while v[pos] > 1 or v[pos - 1] > 1:
	if v[-1] != 0:
		print('PL', end='')
		v[-1] -= 1
	else:
		print('L', end='')
	if v[-2] != 0:
		print('PR', end='')
		v[-2] -= 1
	else:
		print('R', end='')
if v[pos] != 0:
	print('P')
if v[pos - 1] != 0:
	print('LP')


strx = ''
a = int(input())
l = list(map(int, input().split(' ')))
strx += 'PRL' * l[0]
ok = [0] + [i for i in range(a) if l[i] > 0]
ok = list(set(ok))
for i in range(1, len(ok)):
	strx += 'R' * (ok[i] - ok[i - 1])
	strx += 'PLR' * l[ok[i]]
print(strx)


n = int(input())
a = list(map(int, input().split()))
for i in range(n - 1):
	for j in range(a[i]):
		print('PRL', end='')
	print('R', end='')
for j in range(a[n - 1]):
	print('PLR', end='')
print()


n = int(input())
l = input().split(' ')
a = []
for i in range(n):
	a.append(int(l[i]))
s = ''
for i in range(n):
	for j in range(a[i], 0, -1):
		if j == 1:
			s = s + 'P'
		elif j > 1:
			if i > 0:
				s = s + 'PLR'
			else:
				s = s + 'PRL'
	s = s + 'R'
print(s[0:len(s) - 1])


n = int(input())
a = list(map(int, input().split()))
c = 0
ans = ''
while max(a) > 0:
	for x in range(n):
		if a[x] > 0:
			a[x] -= 1
			ans += 'P'
		if x < n - 1:
			ans += 'R'
		else:
			ans += 'L'
	for y in range(n - 2, 0, -1):
		if a[y] > 0:
			a[y] -= 1
			ans += 'P'
		if y > 0:
			ans += 'L'
print(ans)


n = int(input())
s = ''
l = list(map(int, input().split()))
flag = 1
move = 'r'
lenn = 0
while flag == 1:
	flag = 0
	if move == 'r':
		for i in range(n - 1):
			if l[i] >= 1:
				flag = 1
				l[i] -= 1
				s += 'P'
				lenn = len(s)
			if i != n - 1:
				s += 'R'
		move = 'l'
	if move == 'l':
		for i in range(n - 1, 0, -1):
			if l[i] >= 1:
				flag = 1
				l[i] -= 1
				s += 'P'
				lenn = len(s)
			if i != 0:
				s += 'L'
		move = 'r'
print(s[:lenn])


def main():
	n = int(input())
	l = list(map(int, input().split()))
	res = []
	(lo, hi) = (0, n - 1)
	while any(l):
		keysoneflag = True
		for i in range(lo, hi):
			if l[i]:
				if keysoneflag:
					keysoneflag = False
					lo = i
				l[i] -= 1
				res.append('P')
			res.append('R')
		keysoneflag = True
		for i in range(hi, lo, -1):
			if l[i]:
				if keysoneflag:
					keysoneflag = False
					hi = i
				l[i] -= 1
				res.append('P')
			res.append('L')
	if res[-1] != 'P':
		del res[-1]
	print(''.join(res))
main()


n = int(input())
wallets = [int(inp) for inp in input().split()]
res = []
for s in range(wallets[0]):
	res.append('RLP')
if wallets[0] == 0:
	res.append('')
for w in range(1, n):
	res.append('R')
	for e in range(wallets[w]):
		res.append('LRP')
	if wallets[w] == 0:
		res.append('')
print(''.join(res))


n = int(input())
arr = [int(i) for i in input().split()]
ans = []
for i in range(n - 1):
	while arr[i]:
		ans.append('PRL')
		arr[i] -= 1
	ans.append('R')
while arr[-1]:
	ans.append('PLR')
	arr[-1] -= 1
print(''.join(ans))


n = int(input())
c = list(map(int, input().split()))
tmpc = [0] * n
pos = 0
s = ''
put = False
while tmpc != c:
	if c[pos] > tmpc[pos] and put is False:
		s += 'P'
		tmpc[pos] += 1
		put = True
	else:
		l = True
		for cont in range(1, n):
			if pos + cont < n and c[pos + cont] > tmpc[pos + cont]:
				s += 'R' * cont
				pos += cont
				put = False
				l = False
				break
			elif pos - cont >= 0 and c[pos - cont] > tmpc[pos - cont]:
				s += 'L' * cont
				pos -= cont
				put = False
				l = False
				break
		if l:
			if pos > 0:
				s += 'LR'
				put = False
			else:
				s += 'RL'
				put = False
print(s)


n = int(input())
s = list(map(int, input().split()))
r = ''
for i in range(n):
	if s[i] > 0:
		if i == 0:
			r += 'P' + 'RLP' * max(0, s[i] - 1)
		else:
			r += 'R'
			r += 'P' + 'LRP' * max(0, s[i] - 1)
	elif i > 0:
		r += 'R'
print(r)


n = int(input())
arr = list(map(int, input().split()))
for i in range(n - 1):
	while arr[i] > 0:
		print('PRL', end='')
		arr[i] -= 1
	print('R', end='')
while arr[n - 1] > 0:
	print('PLR', end='')
	arr[n - 1] -= 1


I = input
R = range
P = ''
n = int(I())
a = list(map(int, I().split()))
t = sum(a)
while t:
	for i in R(n - 1):
		if a[i]:
			a[i] -= 1
			t -= 1
			P += 'P'
		P += 'R'
	for i in R(n - 1, 0, -1):
		if a[i]:
			a[i] -= 1
			t -= 1
			P += 'P'
		P += 'L'
print(P)


from sys import stdin, stdout
input = stdin.readline
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	f = False
	while a[i]:
		if a[i] and (not f):
			stdout.write('P')
			a[i] -= 1
			f = True
		elif i == 0:
			stdout.write('RLP')
			a[i] -= 1
		else:
			stdout.write('LRP')
			a[i] -= 1
	if i != n - 1:
		stdout.write('R')


a = int(input())
l = input().split()
d = {}
for i in range(a):
	d[i] = int(l[i])

def check(d):
	t = 0
	for i in range(a):
		if d[i] != 0:
			t = 1
			return False
		else:
			t = 0
	if t == 0:
		return True
p = ''
for i in range(10000000):
	if check(d) == False:
		if i % 2 == 0:
			for j in range(a):
				if i > 0 and j == 0:
					p = p
				elif j == a - 1:
					if d[j] == 0:
						p = p + 'L'
					elif d[j] > 0:
						p = p + 'PL'
						d[j] = d[j] - 1
				elif d[j] == 0:
					p = p + 'R'
				elif d[j] > 0:
					p = p + 'PR'
					d[j] = d[j] - 1
		else:
			for j in range(a - 2, -1, -1):
				if j == a - 1:
					p = p
				elif j == 0:
					if d[j] == 0:
						p = p + 'R'
					elif d[j] > 0:
						p = p + 'PR'
						d[j] = d[j] - 1
				elif d[j] == 0:
					p = p + 'L'
				elif d[j] > 0:
					p = p + 'PL'
					d[j] = d[j] - 1
	else:
		h = p[0]
		for i in range(1, len(p) - 1):
			h = h + p[i]
		print(h)
		break


__author__ = 'asmn'
(n, a) = (int(input()), list(map(int, input().split())))
(pos, dir) = (0, 1)
tot = sum(a)
op = {1: 'R', -1: 'L'}
while tot:
	if a[pos] > 0:
		print('P', end='')
		tot -= 1
		a[pos] -= 1
	if not 0 <= pos + dir < n:
		dir = -dir
	print(op[dir], end='')
	pos += dir
print()


n = int(input())
coins = list(map(int, input().split()))
maxi1 = max(coins) + 3
maxi2 = coins[-1] * 2 + 3
maxi3 = coins[0] * 2 + 3
maxi = max(maxi1, maxi2, maxi3)
if coins[0] != 0:
	coins[0] -= 1
	print('P', end='')
i = 0
while i < maxi:
	for j in range(1, n):
		print('R', end='')
		if coins[j] != 0:
			coins[j] -= 1
			print('P', end='')
	for j in range(n - 2, -1, -1):
		print('L', end='')
		if coins[j] != 0:
			coins[j] -= 1
			print('P', end='')
	i += 2


n = int(input())
l = list(map(int, input().split()))
for i in range(n + 1):
	if i == n:
		break
	if i == n - 1:
		print(l[i] * 'PLR', end='')
	else:
		print(l[i] * 'PRL' + 'R', end='')


n = int(input())
arr = input().split()
last = 'r'
arr2 = []
for i in range(n):
	arr2.append(0)
i = 0
while arr != arr2:
	arr[i] = int(arr[i])
	arr2[i] = int(arr2[i])
	if last == 'r':
		if i < n - 1:
			i += 1
			arr[i] = int(arr[i])
			arr2[i] = int(arr2[i])
			print('R', end='')
			if arr[i] != arr2[i]:
				print('P', end='')
				arr2[i] += 1
		else:
			last = 'l'
			i -= 1
			arr[i] = int(arr[i])
			arr2[i] = int(arr2[i])
			print('L', end='')
			if arr[i] != arr2[i]:
				print('P', end='')
				arr2[i] += 1
	elif i > 0:
		i -= 1
		arr[i] = int(arr[i])
		arr2[i] = int(arr2[i])
		print('L', end='')
		if arr[i] != arr2[i]:
			print('P', end='')
			arr2[i] += 1
	else:
		last = 'r'
		i += 1
		arr[i] = int(arr[i])
		arr2[i] = int(arr2[i])
		print('R', end='')
		if arr[i] != arr2[i]:
			print('P', end='')
			arr2[i] += 1


n = int(input())
a = [int(i) for i in input().split()]
l = [0] * len(a)
i = 0
s = ''
while i <= len(a) - 1:
	if l[i] == a[i]:
		s = s + 'R'
		i = i + 1
	elif i == 0:
		e = a[i] - l[i]
		s = s + 'PRL' * (e - 1) + 'PR'
		i = i + 1
	else:
		e = a[i] - l[i]
		s = s + 'PLR' * (e - 1) + 'PR'
		i = i + 1
if s[-1] == 'R' or s[-1] == 'L':
	s = s[0:len(s) - 1]
print(s)


x = int(input(''))
mystring = ''
g = input('').split(' ')
for t in range(0, len(g)):
	if g[t] == '0':
		if t == len(g) - 1:
			mystring = mystring
		else:
			mystring = mystring + 'R'
	elif t == 0:
		for i in range(0, int(g[0])):
			mystring = mystring + 'RLP'
		mystring = mystring + 'R'
	elif t == len(g) - 1:
		for i in range(0, int(g[len(g) - 1])):
			mystring = mystring + 'LRP'
	else:
		for i in range(0, int(g[t])):
			mystring = mystring + 'RLP'
		mystring = mystring + 'R'
print(mystring)


import sys
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	if i == n - 1:
		if a[i] == 0:
			break
		sys.stdout.write('P')
		a[i] -= 1
		while a[i] > 0:
			sys.stdout.write('LRP')
			a[i] -= 1
	else:
		if a[i] == 0:
			sys.stdout.write('R')
			continue
		sys.stdout.write('P')
		a[i] -= 1
		while a[i] > 0:
			sys.stdout.write('R')
			if a[i + 1] > 0:
				sys.stdout.write('PL')
				a[i + 1] -= 1
			else:
				sys.stdout.write('L')
			a[i] -= 1
			sys.stdout.write('P')
		sys.stdout.write('R')


import sys

def get_single_int():
	return int(sys.stdin.readline().strip())

def get_string():
	return sys.stdin.readline().strip()

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
n = get_single_int()
ar = get_list()
s = 'PRL' * ar[0]
for i in range(1, n):
	s += 'R' + 'PLR' * ar[i]
print(s)


n = int(input())
a = [int(x) for x in input().split()]
sm = sum(a)
lst = []
pos = 0
turn = 1
while sm > 0:
	if a[pos] > 0:
		lst.append('P')
		sm -= 1
		a[pos] -= 1
	if pos + turn not in range(len(a)):
		turn = -turn
	pos += turn
	if turn == 1:
		lst.append('R')
	else:
		lst.append('L')
print(''.join(lst[:-1]))


n = int(input())
k = 0
s = ' '
a = list(map(int, input().split()))
while sum(a):
	for i in range(n):
		if s[-1] != 'P':
			if a[i] > 0:
				s += 'P'
				a[i] -= 1
			if i < n - 1:
				s += 'R'
		else:
			s += 'R'
	if sum(a):
		for i in range(n - 1, -1, -1):
			if s[-1] != 'P':
				if a[i] > 0:
					s += 'P'
					a[i] -= 1
				if i and sum(a):
					s += 'L'
			else:
				s += 'L'
print(s[1:])


n = int(input())
a = list(map(int, input().split()))
for i in range(0, n - 1):
	while a[i] > 0:
		print('PR', end='')
		a[i] -= 1
		if a[i] > 0:
			if a[i + 1] > 0:
				a[i + 1] -= 1
				print('P', end='')
			print('L', end='')
		else:
			break
	else:
		print('R', end='')
if a[-1] > 0:
	a[-1] -= 1
	print('P', end='')
while a[-1] > 0:
	a[-1] -= 1
	print('LRP', end='')


import sys

def main():
	n = int(input())
	a = list(map(int, input().split(' ')))
	s = sum(a)
	i = 0
	while s > 0:
		if a[i] > 0:
			x = a[i]
			a[i] -= x
			s -= x
			if i < n - 1:
				sys.stdout.write('PRL' * x)
			else:
				sys.stdout.write('PLR' * x)
		if s > 0:
			i += 1
			sys.stdout.write('R')
	sys.stdout.write('\n')
main()


n = int(input())
lis = list(map(int, input().split()))
command = 'PRL' * lis[0]
for i in range(1, len(lis)):
	command += 'R' + 'LRP' * lis[i]
print(command)


n = int(input())
line = str(input()).split()
line = [int(it) for it in line]
turn = max(line)
inst = str()
for i in range(turn):
	for j in range(n):
		if i < line[j]:
			inst += 'P'
		if j < n - 1:
			inst += 'R'
	inst += 'L' * (n - 1)
print(inst)


wallets = int(input())
coins = input()
coins = [int(i) for i in coins.split(' ')]
robot_pos = 0
instructions = ''
while robot_pos < wallets - 1:
	if coins[robot_pos] > 0:
		instructions += 'PR'
		coins[robot_pos] -= 1
		if coins[robot_pos] == 0:
			robot_pos += 1
		elif coins[robot_pos + 1] == 0:
			instructions += 'L'
		else:
			instructions += 'PL'
			coins[robot_pos + 1] -= 1
	else:
		instructions += 'R'
		robot_pos += 1
if coins[robot_pos] != 0:
	instructions += 'P'
	coins[robot_pos] -= 1
while coins[robot_pos] != 0:
	instructions += 'LRP'
	coins[robot_pos] -= 1
print(instructions)


n = int(input())
a = list(map(int, input().split()))
ans = ''
while a.count(0) != n:
	for i in range(n - 1):
		if a[i]:
			ans += 'P'
			a[i] -= 1
		ans += 'R'
	if a.count(0) != n:
		for i in reversed(range(1, n)):
			if a[i]:
				ans += 'P'
				a[i] -= 1
			ans += 'L'
print(ans)


int_inp = lambda : int(input())
strng = lambda : input().strip()
strl = lambda : list(input().strip())
mul = lambda : map(int, input().split())
mulf = lambda : map(float, input().split())
seq = lambda : list(map(int, input().split()))
import math
from collections import Counter, defaultdict
n = int(input())
l = list(map(int, input().split()))
for i in range(n + 1):
	if i == n:
		break
	if i == n - 1:
		print(l[i] * 'PLR', end='')
	else:
		print(l[i] * 'PRL' + 'R', end='')


(l, s, l) = (input(), '', list(map(int, input().split())))
for i in range(len(l)):
	if l[i] != 0:
		if (len(s) < 2 or s[-1] == 'R') and l[i] == 1:
			s += 'PR'
		else:
			if i != 0:
				s += 'PLR' * l[i]
			else:
				s += 'PRL' * l[i]
			s += 'R'
	else:
		s += 'R'
print(s[:-1])


n = int(input().strip())
a = list(map(int, input().split()))
direction = 1
effective_ops = sum(a)
current_index = 0
op_string = ''
while effective_ops > 0:
	if current_index == n - 1:
		direction = -1
	if current_index == 0:
		direction = 1
	current_num = a[current_index]
	if current_num > 0:
		a[current_index] -= 1
		op_string += 'P'
		effective_ops -= 1
		if effective_ops <= 0:
			break
	if direction == 1:
		op_string += 'R'
		current_index += 1
	else:
		op_string += 'L'
		current_index -= 1
print(op_string)


n = int(input())
string = input()
coins = list(map(int, string.split()))
s = ''
for x in range(n):
	a = coins[x]
	if x == n - 1:
		s += 'PLR' * (a - 1)
	else:
		s += 'PRL' * (a - 1)
	if a > 0:
		s += 'P'
	if x < n - 1:
		s += 'R'
print(s)


n = int(input())
alist = list(map(int, input().split()))
forward = 1
robotl = list()
total = sum(alist)
while total > 0:
	if forward:
		for i in range(0, n - 1, 1):
			if alist[i] > 0:
				alist[i] = alist[i] - 1
				total = total - 1
				robotl.append('P')
			if total > 0:
				robotl.append('R')
		forward = 1 - forward
	else:
		for i in range(n - 1, 0, -1):
			if alist[i] > 0:
				alist[i] = alist[i] - 1
				total = total - 1
				robotl.append('P')
			if total > 0:
				robotl.append('L')
		forward = 1 - forward
print(''.join(robotl))


import sys
n = int(sys.stdin.readline())
a = [int(x) for x in sys.stdin.readline().split(' ')]
i = 0
while True:
	if a[i] != 0:
		a[i] -= 1
		print('P', end='')
	left = 1
	while i - left >= 0 and a[i - left] == 0:
		left += 1
	right = 1
	while i + right <= n - 1 and a[i + right] == 0:
		right += 1
	left_money = 0
	right_money = 0
	if i - left >= 0:
		left_money = a[i - left]
	if i + right <= n - 1:
		right_money = a[i + right]
	if left_money + right_money == 0:
		if a[i] == 0:
			break
		elif i > 0:
			print('LRP' * a[i])
			break
		else:
			print('RLP' * a[i])
			break
	if left_money and right_money:
		if left < right:
			i -= left
			print('L' * left, end='')
		elif left > right:
			i += right
			print('R' * right, end='')
		elif a[i - left] >= a[i + right]:
			i -= left
			print('L' * left, end='')
		else:
			i += right
			print('R' * right, end='')
	elif left_money:
		i -= left
		print('L' * left, end='')
	else:
		i += right
		print('R' * right, end='')


l = int(input())
a = list(map(int, input().split()))
(n, r, t) = (sum(a), '', 0)
while n:
	t = (t + 1) % 2
	for i in range(1 - t, l - t)[::2 * t - 1]:
		if a[i]:
			a[i] -= 1
			n -= 1
			r += 'P'
		r += 'LR'[t]
print(r)


n = int(input())
a = list(map(int, input().split()))
c = sum(a)
ans = []
while c > 0:
	for i in range(n):
		while a[i] > 0:
			c -= 1
			ans.append('P')
			if c == 0:
				break
			if i == n - 1:
				ans.append('L')
				ans.append('R')
			else:
				ans.append('R')
				ans.append('L')
			a[i] -= 1
		if c == 0:
			break
		else:
			ans.append('R')
print(''.join(ans))


n = int(input())
wallets = [int(i) for i in input().split()]
pos = 0
output = []
while pos < n:
	if wallets[pos] > 0:
		output.append('P')
		wallets[pos] -= 1
		if pos == n - 1 and wallets[pos] == 0 and (wallets[pos - 1] == 0):
			break
		if pos > 0 and wallets[pos - 1] > 0 or pos == n - 1:
			pos -= 1
			output.append('L')
		else:
			pos += 1
			if pos < n:
				output.append('R')
	elif pos > 0 and wallets[pos - 1] > 0:
		pos -= 1
		output.append('L')
	else:
		pos += 1
		if pos < n:
			output.append('R')
print(''.join(output))


from sys import stdin, stdout

def solve(wp0):
	result = ''
	wn = len(wp0)
	wp = [0 for i in wp0]
	pos = 0
	for i in range(0, wn):
		while wp[i] < wp0[i]:
			result += 'P'
			wp[pos] += 1
			if wp[pos] == wp0[i]:
				break
			if pos != wn - 1:
				result += 'R'
				pos += 1
				result += 'L'
				pos -= 1
			else:
				result += 'L'
				pos -= 1
				result += 'R'
				pos += 1
		result += 'R'
		pos += 1
	return result[:-1]
wn = int(stdin.readline())
wp = [int(i) for i in stdin.readline().split(' ')]
result = solve(wp)
print(result)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
napr = True
i = 0
while s > 0:
	if napr:
		i += 1
		print('R', end='')
	else:
		i -= 1
		print('L', end='')
	if a[i]:
		a[i] -= 1
		s -= 1
		print('P', end='')
	if i == n - 1 and napr or (i == 0 and (not napr)):
		napr = not napr


n = int(input())
l = list(map(int, input().split()))
print('PRL' * l[0] + ''.join(('R' + i * 'PLR' for i in l[1:])))


(n, ans) = (int(input()), '')
a = list(map(int, input().split()))
print('PRL' * int(a[0]) + ''.join(('R' + int(i) * 'PLR' for i in a[1:])))


n = int(input())
lst = list(map(int, input().strip().split(' ')))
s = ''
for i in range(n):
	if lst[i] == 0 and i != n - 1:
		s += 'R'
	elif i == n - 1 and lst[i] == 0:
		continue
	elif i == 0:
		s += 'PRL' * lst[i]
		s += 'R'
	elif i == n - 1:
		s += 'PLR' * lst[i]
	else:
		s += 'PLR' * (lst[i] - 1)
		s += 'PR'
print(s)


a = int(input())
b = list(map(int, input().split()))
x = [0 for i in range(a)]
pos = 0
string = 'x'
direction = 1
while x != b:
	if string[-1] != 'P':
		if x[pos] != b[pos]:
			x[pos] += 1
			string += 'P'
	if direction == 1:
		if pos != a - 1:
			pos += 1
			string += 'R'
		else:
			direction = -1
			string += 'L'
			pos -= 1
	elif pos != 0:
		pos -= 1
		string += 'L'
	else:
		direction = 1
		string += 'R'
		pos += 1
print(string[1:])


n = int(input())
w = input()
w = w.split(' ')
w = list(map(int, w))
for i in range(n - 1):
	while w[i] > 1:
		if w[i + 1] > 0:
			print('PRPL', end='')
			w[i + 1] -= 1
		else:
			print('PRL', end='')
		w[i] -= 1
	if w[i] == 1:
		print('PR', end='')
	else:
		print('R', end='')
i = n - 1
while w[i] > 1:
	print('PLR', end='')
	w[i] -= 1
if w[i] == 1:
	print('P', end='')
else:
	print('', end='')


input()
X = []
for a in map(int, input().split()):
	X.append(a * ('PLR' if X else 'PRL'))
print('R'.join(X))


n = int(input())
l = list(map(int, input().split()))
li = [0 for i in range(n)]
i = 0
result = ''
while i < n:
	if l[i] > li[i] and i < n:
		li[i] += 1
		result += 'P'
	if li != l and i < n - 1:
		if li[:i] != l[:i]:
			result += 'L'
			i -= 1
		else:
			result += 'R'
			i += 1
	elif li != l and i == n - 1:
		result += 'L'
		i -= 1
	elif l == li:
		break
print(result)


import sys
input = sys.stdin.readline

def prog():
	n = int(input())
	a = list(map(int, input().split()))
	output = []
	b = [0] * n
	for j in range(300):
		for i in range(n):
			if a[i] != b[i]:
				b[i] += 1
				output.append('P')
			if i != n - 1:
				output.append('R')
		for i in range(n - 1):
			output.append('L')
	print(''.join(output))
prog()


n = int(input())
wallets = map(int, input().split())
ans = ''
for (i, w) in enumerate(wallets):
	for j in range(w):
		go = 'L'
		go2 = 'R'
		if i == 0:
			z = go
			go = go2
			go2 = z
		ans += 'P' + go + go2
	if i < n - 1:
		ans += 'R'
print(ans)


import sys
import string
from collections import Counter, defaultdict
from math import fsum, sqrt, gcd, ceil, factorial
from operator import add
inf = float('inf')
flush = lambda : sys.stdout.flush
comb = lambda x, y: factorial(x) // factorial(y) // factorial(x - y)
ip = lambda : input()
ii = lambda : int(input())
r = lambda : map(int, input().split())
rr = lambda : list(r())
n = ii()
arr = rr()
pos = -1
ans = ''
for i in range(n - 1):
	ans += 'PRL' * arr[i]
	ans += 'R'
ans += 'PLR' * arr[-1]
print(ans)


n = int(input())
a = list(map(int, input().split()))
(ans, used, cu, cp) = (list(), [False for i in range(n)], 0, 0)
(move, tb) = ('R', {'L': -1, 'R': 1})
while cu != n:
	if a[cp] != 0:
		ans.append('P')
		a[cp] -= 1
	if a[cp] == 0 and (not used[cp]):
		cu += 1
		used[cp] = True
	if cp == 0 and move == 'L':
		move = 'R'
	elif cp == n - 1 and move == 'R':
		move = 'L'
	ans.append(move)
	cp += tb[move]
print(''.join(ans))


n = int(input())
l_n = list(map(int, input().split()))
s = ''
for i in range(n):
	if l_n[i] == 0:
		if i + 1 == n:
			print(''.join((c for c in s)))
			quit()
		else:
			s += 'R'
	elif i + 1 == n:
		s += 'PLR' * (l_n[i] - 1) + 'P'
	else:
		s += 'PRPL' * min(l_n[i], l_n[i + 1]) + 'PRL' * max(0, l_n[i] - l_n[i + 1] - 1) + ('PR' if l_n[i] > l_n[i + 1] else 'R')
		l_n[i + 1] = max(l_n[i + 1] - l_n[i], 0)
print(s)


c = int(input())
a = list(map(int, input().split()))
for i in range(0, c - 1):
	if a[i] > 0:
		while a[i]:
			print('PRL', end='')
			a[i] -= 1
	print('R', end='')
if a[-1] > 0:
	while a[-1]:
		print('PLR', end='')
		a[-1] -= 1


n = int(input())
a = list(map(int, input().split()))
s = []
i = 0
while i < n - 1:
	while a[i]:
		s.append('P')
		a[i] -= 1
		s.append('R')
		i += 1
		if a[i]:
			s.append('P')
			a[i] -= 1
		s.append('L')
		i -= 1
	s.append('R')
	i += 1
while a[i]:
	s.append('P')
	a[i] -= 1
	if a[i]:
		s.append('LR')
print(''.join(s))


n = input()
a = []
b = []
for x in input().split():
	a.append(int(x))
	b.append(0)
count = 0
direction = 'R'
booly = 0
while True:
	if a[count] != b[count] and direction == 'R' and (not booly):
		b[count] += 1
		print('P', end='')
		if a == b:
			break
		count += 1
		if count == len(a):
			count -= 1
			direction = 'L'
			booly = 1
			print('L', end='')
			continue
		print('R', end='')
	if a[count] == b[count] and direction == 'R' and (not booly):
		count += 1
		if count == len(a):
			count -= 1
			direction = 'L'
			booly = 1
			print('L', end='')
			continue
		print('R', end='')
	if direction == 'L' and booly:
		booly = 0
		count -= 1
	if a[count] != b[count] and direction == 'L' and (not booly):
		b[count] += 1
		print('P', end='')
		if a == b:
			break
		count -= 1
		if count == -1:
			count += 1
			direction = 'R'
			booly = 1
			print('R', end='')
			continue
		print('L', end='')
	if a[count] == b[count] and direction == 'L' and (not booly):
		count -= 1
		if count == -1:
			count += 1
			direction = 'R'
			booly = 1
			print('R', end='')
			continue
		print('L', end='')
	if direction == 'R' and booly:
		booly = 0
		count += 1


import sys
k = int(input())
a = list(map(int, input().split()))
for i in range(len(a)):
	if i == 0:
		while a[i] > 0:
			sys.stdout.write('PRL')
			a[i] -= 1
	else:
		while a[i] > 0:
			sys.stdout.write('PLR')
			a[i] -= 1
	if i != len(a) - 1:
		sys.stdout.write('R')


from sys import stdin, stdout
from collections import *
st = lambda : list(stdin.readline().strip())
li = lambda : list(map(int, stdin.readline().split()))
mp = lambda : map(int, stdin.readline().split())
inp = lambda : int(stdin.readline())
pr = lambda n: stdout.write(str(n) + '\n')
mod = 1000000007
INF = float('inf')

def solve():
	n = inp()
	l = li()
	ans = ''
	for i in range(n - 1):
		if l[i] != 0:
			ans += 'PRL' * (l[i] - 1) + 'PR'
		else:
			ans += 'R'
	if l[-1] > 0:
		ans += 'PLR' * (l[-1] - 1) + 'P'
	print(ans)
for _ in range(1):
	solve()


n = int(input())
A = list(map(int, input().split()))
import sys
ans = ''
x = 0
ind = 0
for i in range(n):
	if i != 0:
		ans += 'R'
	if i != n - 1:
		ans += 'PRL' * A[i]
	else:
		ans += 'PLR' * A[i]
sys.stdout.write(ans)


n = int(input())
l = list(map(int, input().split()))
ans = ''
for _ in range(max(l)):
	for i in range(n):
		if l[i] != 0:
			ans += 'P'
			l[i] -= 1
		if i != n - 1:
			ans += 'R'
	ans += 'L' * (n - 1)
print(ans)


n = int(input())
a = [int(i) for i in input().split()] + [0]
ans = []
current = 0
while current < n:
	if a[current] > 0 and a[current + 1] > 0:
		ans.append('PRPL')
		a[current] -= 1
		a[current + 1] -= 1
	elif a[current] > 0:
		if current == n - 1:
			ans.append('PLR')
		else:
			ans.append('PRL')
		a[current] -= 1
	else:
		if current != n - 1:
			ans.append('R')
		current += 1
print(''.join(ans))


def solve(n, seq):
	totalCoins = sum(seq)
	index = 0
	previousIndex = 0
	incrementDecrement = 1
	direction = 'R'
	while totalCoins > 0:
		if seq[index] > 0:
			for _ in range(abs(previousIndex - index)):
				print(direction, end='')
			print('P', end='')
			seq[index] -= 1
			totalCoins -= 1
			previousIndex = index
		if index == n - 1 and direction == 'R' or ((index == 0 and direction == 'L') and totalCoins > 0):
			if previousIndex + incrementDecrement < n and previousIndex + incrementDecrement >= 0 and (seq[previousIndex] > 0):
				index = previousIndex + incrementDecrement
				previousIndex = index
				print(direction, end='')
			else:
				index = previousIndex
				index += incrementDecrement * -1
			incrementDecrement *= -1
			if incrementDecrement == -1:
				direction = 'L'
			else:
				direction = 'R'
			continue
		index += incrementDecrement
n = int(input())
seq = list(map(int, input().split()))
solve(n, seq)


n = int(input())
a = list(map(int, input().split()))
r = ' '
move_right = True
while 1:
	if move_right:
		for i in range(n):
			if a[i] > 0 and r[-1] != 'P':
				r += 'P'
				a[i] -= 1
			if i != n - 1:
				r += 'R'
		move_right = not move_right
	else:
		for i in range(n - 1, -1, -1):
			if a[i] > 0 and r[-1] != 'P':
				r += 'P'
				a[i] -= 1
			if i != 0:
				r += 'L'
		move_right = not move_right
	if sum(a) == 0:
		break
print(r[1:])


n = int(input())
l = list(map(int, input().split()))
S = ''
s1 = 'PRPL'
s2 = 'PLR'
s3 = 'PRL'
for i in range(n):
	if i + 1 == n:
		S = S + s2 * l[i]
	if i - 1 < 0:
		if l[i + 1] != 0:
			S = S + s1 * min(l[i + 1], l[i])
			d = min(l[i + 1], l[i])
			l[i + 1] = l[i + 1] - d
			l[i] = l[i] - d
		S = S + s3 * l[i]
		S = S + 'R'
	if i + 1 != n and i - 1 >= 0:
		S = S + s1 * min(l[i + 1], l[i])
		d = min(l[i + 1], l[i])
		l[i + 1] = l[i + 1] - d
		l[i] = l[i] - d
		S = S + s3 * l[i]
		S = S + 'R'
print(S)


n = int(input())
a = list(map(int, input().split()))
print('PRL' * a[0], end='')
for i in range(1, n):
	print('R', end='')
	if i != n - 1:
		print('PRL' * a[i], end='')
	else:
		print('PLR' * a[i])


n = int(input())
l = [int(x) for x in input().split()]
assert len(l) == n
for i in range(n - 1):
	mn = min(l[i], l[i + 1])
	print('PRPL' * mn, end='')
	l[i + 1] -= mn
	l[i] -= mn
	print('PRL' * l[i], end='')
	l[i] = 0
	print('R', end='')
print('PLR' * l[n - 1], end='\n', flush=True)


walletNumber = int(input())
coinsInWallets = [int(i) for i in input().split()]
output = ''
for i in range(len(coinsInWallets)):
	for j in range(coinsInWallets[i]):
		if i != len(coinsInWallets) - 1:
			output += 'PRL'
		else:
			output += 'PLR'
	if i != len(coinsInWallets) - 1:
		output += 'R'
print(output)


n = int(input())
target = [int(x) for x in input().split()]
slon = ''
for i in range(n - 1):
	slon += 'PRL' * (target[i] - 1) + ('R' if target[i] == 0 else 'PR')
slon += 'PLR' * (target[n - 1] - 1) + ('' if target[n - 1] == 0 else 'P')
print(slon)


def main():
	s = input()
	n = int(s)
	s = input()
	d = list(map(int, s.split()))
	t = [0] * n
	i = 0
	while True:
		if t[i] != d[i]:
			print('P', end='')
			t[i] += 1
			while t[i] != d[i]:
				if i + 1 == n:
					print('L', end='')
					print('R', end='')
					print('P', end='')
					t[i] += 1
				else:
					print('R', end='')
					if t[i + 1] != d[i + 1]:
						print('P', end='')
						t[i + 1] += 1
					print('L', end='')
					print('P', end='')
					t[i] += 1
		i += 1
		if i == n:
			break
		print('R', end='')
	print('\n')
main()


n = int(input())
a = list(map(int, input().split()))
i = 0
ans = ''
while i <= len(a) - 1:
	if a[i] == 0 and i != len(a) - 1:
		ans += 'R'
		i += 1
	elif a[i] == 0 and i == len(a) - 1:
		break
	elif a[i] == 1:
		if i == len(a) - 1:
			ans += 'P'
			i += 1
		else:
			ans += 'PR'
			i += 1
	elif i == len(a) - 1:
		ans += 'PLR' * (a[i] - 1) + 'P'
		i += 1
	elif i == 0:
		ans += 'PRL' * (a[i] - 1) + 'PR'
		i += 1
	else:
		ans += 'PRL' * (a[i] - 1) + 'PR'
		i += 1
print(ans)