#include<bits/stdc++.h>
using namespace std;

// Optimization

//#pragma GCC optimize("O3")
#define endl '\n'

// Shortcut

#define int long long
#define eb emplace_back
#define pb push_back
#define pob pop_back
#define mp make_pair
#define upb upper_bound
#define lwb lower_bound
#define fi first
#define se second
#define For(i, l, r) for (int i = l; i < r; i++)
#define ForE(i, l, r) for (int i = l; i <= r; i++)
#define Ford(i, r, l) for (int i = r; i > l; i--)
#define FordE(i, r, l) for (int i = r; i >= l; i--)
#define Fora(i, a) for (auto i : a)

// I/O & Debug

#define PrintV(a) Fora(iiii, a) cout << iiii << ' '; cout << endl;
#define PrintVl(a) Fora(iiii, a) cout << iiii << endl;
#define PrintA(a, l, r) for (int iiii = l; iiii <= r; iiii++) cout << a[iiii] << ' '; cout << endl;
#define PrintAl(a, l, r) for (int iiii = l; iiii <= r; iiii++) cout << a[iiii] << endl;
#define Ptest(x) return cout << x, 0;
#define gl(s) getline(cin, s);
#define setpre(x) fixed << setprecision(x)
/*
#define debug(args...){ string _sDEB = #args; replace(_sDEB.begin(), _sDEB.end(), ',', ' '); stringstream _ssDEB(_sDEB); istream_iterator<string> _itDEB(_ssDEB); DEB(_itDEB, args); }
void DEB(istream_iterator<string> it) {}
template<typename T, typename... Args>
void DEB(istream_iterator<string> it, T a, Args... args){
    cout << *it << " = " << a << endl;
    DEB(++it, args...);
}
*/

// Functions

#define isvowel(a) (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u' || a == 'y')
#define bend(a) a.begin(), a.end()
#define rbend(a) a.rbegin(), a.rend()
#define mset(a) memset(a, 0, sizeof(a))
#define mset1(a) memset(a, 1, sizeof(a))
#define msetn1(a) memset(a, -1, sizeof(a))
#define msetinf(a) memset(a, 0x3f, sizeof(a))
#define gcd __gcd
#define __builtin_popcount __builtin_popcountll
//mt19937 rando(chrono::steady_clock::now().time_since_epoch().count());

// Data Structure

#define pque priority_queue
#define mts multiset
#define y0 _y0_
#define y1 _y1_
#define div divi
typedef long long ll;
typedef long double ld;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <ld> vld;
typedef vector <string> vs;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <vi > vvi;
typedef vector <vll > vvll;
typedef vector <pii > vpii;
typedef vector <pll > vpll;

const int N = 1e5 + 5, mod = 1e9 + 7, mod1 = 998244353, mod2 = 1e9 + 9, inf = 1e18 + 7;
const ll infll = 1e18 + 7;

int n;
int a[N];

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
int q = 1;
// cin >> q;
while (q--){
    cin >> n;
    ForE(i, 1, n){
        cin >> a[i];
    }
    For(i, 1, 300){
        For(j, 1, n){
            if (i & 1){
                if (a[j] >= i) cout << 'P';
                cout << 'R';
            }
            else{
                if (a[n + 1 - j] >= i) cout << 'P';
                cout << 'L';
            }
        }
        if (i & 1){
            if (a[n] >= i) cout << 'P';
            cout << "LR";
        }
        else{
            if (a[1] >= i) cout << 'P';
            cout << "RL";
        }
    }
}
}

/*
==================================+
INPUT:                            |
------------------------------    |

------------------------------    |
==================================+
OUTPUT:                           |
------------------------------    |

------------------------------    |
==================================+
*/


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <deque>

using namespace std;
typedef long long ll;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<int> a(n);
    for (auto &i : a){
        cin >> i;
    }
    int i = 0;
    string answ = "";
    while (i < n){
        if (a[i] > 0){
            --a[i];
            answ += "P";
            if (i < n - 1){
                answ += "RL";
            } else if (i > 0){
                answ += "LR";
            }
        } else {
            answ += "R";
            ++i;
        }
    }
    cout << answ << '\n';
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <deque>

using namespace std;
typedef long long ll;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<int> a(n);
    for (auto &i : a){
        cin >> i;
    }
    int i = 0;
    string answ = "";
    while (i < n){
        if (a[i] > 0){
            --a[i];
            answ += "P";
            if (i < n - 1){
                answ += "RL";
            } else if (i > 0 and a[i] > 0){
                answ += "LR";
            }
        } else if (i < n - 1){
            answ += "R";
            ++i;
        } else {
            ++i;
        }
    }
    cout << answ << '\n';
}


#include<bits/stdc++.h>
using namespace std;
#define maxn  308
int n;
int a[maxn];
string ans;
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
    for(int i=1;i<=n;i++){
        if(i!=1){
            for(int j=1;j<=a[i];j++){
                printf("LRP");
            }
        }else{
            for(int j=1;j<=a[i];j++){
                printf("RLP");
            }
        }
        if(i!=n)printf("R");
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define maxn  308
int n;
int a[maxn];
string ans;
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
    for(int i=1;i<=n;i++){
        if(i!=1){
            for(int j=1;j<=a[i];j++){
                ans=ans+"L"+"R"+"P";
            }
        }else{
            for(int j=1;j<=a[i];j++){
                ans=ans+"R"+"L"+"P";
            }
        }
        if(i!=n)ans=ans+"R";
    }
    cout<<ans<<endl;
    // cout<<(int)ans.length()<<endl;
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace std;
#define getbit(n, i) (((n) & (1LL << (i))) != 0)
#define setbit0(n, i) ((n) & (~(1LL << (i))))
#define setbit1(n, i) ((n) | (1LL << (i)))
#define togglebit(n, i) ((n) ^ (1LL << (i)))
#define lastone(n) ((n) & (-(n)))
char gap = 32;
template<typename T>
ostream& operator<<(ostream &os, const vector<T> &v) {
    os << '{';
    for (const auto &x : v) os << gap << x;
        return os << '}';
}
template<typename A, typename B>
ostream& operator<<(ostream &os, const pair<A, B> &p) {
        return os << '(' << p.first << gap << p.second << ')';
}

template <class T>
void read(T &x) {
    char c;
    for (c = getchar(); c < '0' || c > '9'; c = getchar())
        ;
    for (x = 0; c <= '9' && c >= '0'; c = getchar()) x = x * 10 + (c & 15);
}
#define ll long long
#define lll __int128_t
#define pb push_back
#define mp make_pair
typedef pair < int,int> ii;
typedef vector<ii> vii;
typedef vector<ll>vl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll hashPrime = 1610612741;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll i, j, k, l, n, m;
    cin >> n;
    vector<ll> data(n + 1),cnt(n+1,0);
    for (i = 1; i <= n;i++)
        cin >> data[i];
    for (i = 1; i <= n;i++){
        while(data[i]>0){
            cout << "P";
            if(i<n)
                cout << "RL";
            else{
                cout << "LR";
            }
            data[i]--;
        }
        cout << "R";
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace std;
#define getbit(n, i) (((n) & (1LL << (i))) != 0)
#define setbit0(n, i) ((n) & (~(1LL << (i))))
#define setbit1(n, i) ((n) | (1LL << (i)))
#define togglebit(n, i) ((n) ^ (1LL << (i)))
#define lastone(n) ((n) & (-(n)))
char gap = 32;
template<typename T>
ostream& operator<<(ostream &os, const vector<T> &v) {
    os << '{';
    for (const auto &x : v) os << gap << x;
        return os << '}';
}
template<typename A, typename B>
ostream& operator<<(ostream &os, const pair<A, B> &p) {
        return os << '(' << p.first << gap << p.second << ')';
}

template <class T>
void read(T &x) {
    char c;
    for (c = getchar(); c < '0' || c > '9'; c = getchar())
        ;
    for (x = 0; c <= '9' && c >= '0'; c = getchar()) x = x * 10 + (c & 15);
}
#define ll long long
#define lll __int128_t
#define pb push_back
#define mp make_pair
typedef pair < int,int> ii;
typedef vector<ii> vii;
typedef vector<ll>vl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll hashPrime = 1610612741;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll i, j, k, l, n, m;
    cin >> n;
    vector<ll> data(n + 1),cnt(n+1,0);
    for (i = 1; i <= n;i++)
        cin >> data[i];
    for (i = 1; i <= n;i++){
        while(data[i]>0){
            cout << "P";
            if(i<n)
                cout << "RL";
            else{
                cout << "LR";
            }
            data[i]--;
        }
        if(i<n)
            cout << "R";
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace std;
#define getbit(n, i) (((n) & (1LL << (i))) != 0)
#define setbit0(n, i) ((n) & (~(1LL << (i))))
#define setbit1(n, i) ((n) | (1LL << (i)))
#define togglebit(n, i) ((n) ^ (1LL << (i)))
#define lastone(n) ((n) & (-(n)))
char gap = 32;
template<typename T>
ostream& operator<<(ostream &os, const vector<T> &v) {
    os << '{';
    for (const auto &x : v) os << gap << x;
        return os << '}';
}
template<typename A, typename B>
ostream& operator<<(ostream &os, const pair<A, B> &p) {
        return os << '(' << p.first << gap << p.second << ')';
}

template <class T>
void read(T &x) {
    char c;
    for (c = getchar(); c < '0' || c > '9'; c = getchar())
        ;
    for (x = 0; c <= '9' && c >= '0'; c = getchar()) x = x * 10 + (c & 15);
}
#define ll long long
#define lll __int128_t
#define pb push_back
#define mp make_pair
typedef pair < int,int> ii;
typedef vector<ii> vii;
typedef vector<ll>vl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll hashPrime = 1610612741;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll i, j, k, l, n, m;
    cin >> n;
    vector<ll> data(n + 1),cnt(n+1,0);
    for (i = 1; i <= n;i++)
        cin >> data[i];
    for (i = 1; i <= n;i++){
        while(data[i]>0){
            cout << "P";
            if(i<n)
                cout << "RL";
            else{
                cout << "LR";
            }
            data[i]--;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define DEBUG 1
#define cerr if (DEBUG) cerr
#define fprintf if (DEBUG) fprintf
#define local freopen("in.txt","r",stdin);
#define test cerr<<"hi\n";
#define tr(x) cerr<<#x" "<<x<<'\n';
#define fi first
#define se second
#define HH1 402653189
#define HH2 1610612741
#define INF 0x3f3f3f3f
#define tii tuple<int,int,int>
#define npos string::npos

#define MOD 1000000007LL

using namespace std;

int dir = -1, pos=1,a[305],n;
vector<char> v;

int main(){

	cin >> n;
	for (int i=1;i<=n;i++) cin >> a[i];

	for (int i=1;i<=1000000;i++){
		if (a[pos]) v.pb('P'),a[pos]--;
		if (pos==1) dir=1;
		if (pos==n) dir=-1;
		if (dir==1) v.pb('R'); else v.pb('L');
		pos+=dir;
	}

	for (char c:v) cout << c;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define DEBUG 1
#define cerr if (DEBUG) cerr
#define fprintf if (DEBUG) fprintf
#define local freopen("in.txt","r",stdin);
#define test cerr<<"hi\n";
#define tr(x) cerr<<#x" "<<x<<'\n';
#define fi first
#define se second
#define HH1 402653189
#define HH2 1610612741
#define INF 0x3f3f3f3f
#define tii tuple<int,int,int>
#define npos string::npos

#define MOD 1000000007LL

using namespace std;

int dir = -1, pos=1,a[305],n;
vector<char> v;

int main(){

	cin >> n;
	for (int i=1;i<=n;i++) cin >> a[i];

	while (v.size()<=1000000-5){
		if (a[pos]) v.pb('P'),a[pos]--;
		if (pos==1) dir=1;
		if (pos==n) dir=-1;
		if (dir==1) v.pb('R'); else v.pb('L');
		pos+=dir;
	}

	for (char c:v) cout << c;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define DEBUG 1
#define cerr if (DEBUG) cerr
#define fprintf if (DEBUG) fprintf
#define local freopen("in.txt","r",stdin);
#define test cerr<<"hi\n";
#define tr(x) cerr<<#x" "<<x<<'\n';
#define fi first
#define se second
#define HH1 402653189
#define HH2 1610612741
#define INF 0x3f3f3f3f
#define tii tuple<int,int,int>
#define npos string::npos

#define MOD 1000000007LL

using namespace std;

int dir = -1, pos=1,a[305],n;
vector<char> v;

int main(){

	cin >> n;
	for (int i=1;i<=n;i++) cin >> a[i];

	for (int i=1;i<=1000000;i++){
		if (a[pos]) v.pb('P'),a[pos]--;
		if (pos==1) dir=1;
		if (pos==n) dir=-1;
		if (dir==1) v.pb('R'); else v.pb('L');
		pos+=dir;
	}

	cout << 1000000 << endl;
	for (char c:v) cout << c;

}


#include "bits/stdc++.h"
#pragma GCC optimize("O3,Ofast,no-stack-protector,unroll-loops,fast-math")

using namespace std;

using ll = long long;
#define all(x) begin(x), end(x)

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
	int n; cin >> n;
	vector<int> arr(n);
	for(int i{}; i<n; i++) cin >> arr[i];
	for(int i{}; i<n; i++)
	{
		for(int j{}; j<arr[i]; j++)
			cout << 'P';

		cout << (i!=n-1?"R":"");
	}

}


#include "bits/stdc++.h"
#pragma GCC optimize("O3,Ofast,no-stack-protector,unroll-loops,fast-math")

using namespace std;

using ll = long long;
#define all(x) begin(x), end(x)

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
	int n; cin >> n;
	vector<int> a(n+1);
	string ans;
	int pos = 1;
	for(int i{1}; i<=n; i++) cin >> a[i];
	while(true){
        if(a[pos])
        {
            ans+='P';
            a[pos]--;
            if(pos==1)
                ans+="RL";
            else
                ans+="LR";
        }
        else if(pos==n)
            break;
        else
            ans+='R',pos++;
		}
	cout << ans << "\n";
}


#include "bits/stdc++.h"
#pragma GCC optimize("O3,Ofast,no-stack-protector,unroll-loops,fast-math")

using namespace std;

using ll = long long;
#define all(x) begin(x), end(x)

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
	int n; cin >> n;
	vector<int> arr(n);
	for(int i{}; i<n; i++) cin >> arr[i];
	for(int i{}; i<n; i++)
	{
		for(int j{}; j<arr[i]; j++){
			cout << 'P';
			cout << 'R';
			cout << 'L';
		}

		cout << (i!=n-1?"R":"");
	}

}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){

ll n;
cin>>n;
ll a[n+1];
for(ll i=0;i<n;i++)
{
    cin>>a[i];
}

for(ll i=0;i<n;i++)
{
    if(a[i]!=0)
    {
        if(i==0)
        {
            while(1)
            {
                cout<<"P";
                a[i]--;
                if(a[i]==0)
                    break;
                else
                    cout<<"RL";
            }
        }
        else
        {
            while(1)
            {
                cout<<"P";
                a[i]--;
                if(a[i]==0)
                    break;
                else
                    cout<<"LR";
            }
        }
    }
    if(i<n-1)
        cout<<"R";
}

}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){

ll n;
cin>>n;
ll a[n+1];
for(ll i=0;i<n;i++)
{
    cin>>a[i];
}
for(ll i=0;i<n;i++)
{
    if(a[i]!=0)
    {
        while(1)
        {
            cout<<"P";
                a[i]--;
            if(a[i]==0)
                break;
            else if(i==0)
                cout<<"RL";
            else
                cout<<"LR";
        }
    }
    if(i<n-1)
        cout<<"R";
}
return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{

    ll i,j,k,a,b,c,n,t,m,d;
    vector<ll> v,s,ss,vv;
    map<ll,ll> ma,sa;
    map<ll,ll> :: iterator it,ki;
    string st,et;
    cin>>n;
    for(i=1; i<=n; i++)
    {
        cin>>a;
        ma[i] = a;
    }
    for(j=1;; j++)
    {
        c = 0;
        if(j%2==1)
        {
            for(i=1; i<=n; i++)
            {
                if(ma[i]==0 && i!=n)
                {
                    st.push_back('R');
                    c++;
                }
                else if(ma[i]>0 && i!=n)
                {
                    st.push_back('P');
                     st.push_back('R');
                    ma[i]--;
                }
                if(i==n && ma[i]>0){
                    ma[i]--;
                    st.push_back('P');
                    st.push_back('L');
                }
                else if(i==n && ma[i]==0){
                    c++;
                }
            }
            if(c==n){
                break;
            }
        }
     else  if(j%2==0)
        {
            c = 0;
            for(i=n; i>=1; i--)
            {
                if(ma[i]==0 && i!=1 && i!=n)
                {
                    st.push_back('L');
                    c++;
                }
                else if(ma[i]>0 && i!=n && i!=1)
                {
                    st.push_back('P');
                     st.push_back('L');
                    ma[i]--;
                }
                if(i==n && ma[i]==0){
                  st.push_back('L');
                  c++;
                }
                if(i==1 && ma[i]==0){
                    c++;
                }
            }
            if(c==n){
                break;
            }
        }
    }
    cout<<st<<endl;

}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{

    ll i,j,k,a,b,c,n,t,m,d;
    vector<ll> v,s,ss,vv;
    map<ll,ll> ma,sa;
    map<ll,ll> :: iterator it,ki;
    string st,et;
    cin>>n;
    for(i=1; i<=n; i++)
    {
        cin>>a;
        ma[i] = a;
    }
    for(j=1;; j++)
    {
        c = 0;
        if(j%2==1)
        {
            for(i=1; i<=n; i++)
            {
                if(ma[i]==0 && i!=n)
                {
                    st.push_back('R');
                    c++;
                }
                else if(ma[i]>0 && i!=n)
                {
                    st.push_back('P');
                     st.push_back('R');
                    ma[i]--;
                }
                if(i==n && ma[i]>0){
                    ma[i]--;
                    st.push_back('P');
                    st.push_back('L');
                }
                else if(i==n && ma[i]==0){
                    c++;
                }
            }
            if(c==n){
                break;
            }
        }
     else  if(j%2==0)
        {
            c = 0;
            for(i=n; i>=1; i--)
            {
                if(ma[i]==0 && i!=1 && i!=n)
                {
                    st.push_back('L');
                    c++;
                }
                else if(ma[i]>0 && i!=n && i!=1)
                {
                    st.push_back('P');
                     st.push_back('L');
                    ma[i]--;
                }
                if(i==n && ma[i]==0){
                  c++;
                }
                if(i==1 && ma[i]==0){
                    c++;
                }
            }
            if(c==n){
                break;
            }
        }
    }
    cout<<st<<endl;

}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{

    ll i,j,k,a,b,c,n,t,m,d;
    vector<ll> v,s,ss,vv;
    map<ll,ll> ma,sa;
    map<ll,ll> :: iterator it,ki;
    string st,et;
    cin>>n;
    for(i=1; i<=n; i++)
    {
        cin>>a;
        ma[i] = a;
    }
    for(j=1;; j++)
    {
        c = 0;
        if(j%2==1)
        {
            for(i=1; i<=n; i++)
            {
                if(ma[i]==0 && i!=n)
                {
                    st.push_back('R');
                    c++;
                }
                else if(ma[i]>0 && i!=n)
                {
                    st.push_back('P');
                     st.push_back('R');
                    ma[i]--;
                }
                if(i==n && ma[i]>0){
                    ma[i]--;
                    st.push_back('P');
                }
                else if(i==n && ma[i]==0){
                    c++;
                }
            }
            if(c==n){
                break;
            }
        }
     else  if(j%2==0)
        {
            c = 0;
            for(i=n; i>=1; i--)
            {
                if(ma[i]==0 && i!=1 && i!=n)
                {
                    st.push_back('L');
                    c++;
                }
                else if(ma[i]>0 && i!=n && i!=1)
                {
                    st.push_back('P');
                     st.push_back('L');
                    ma[i]--;
                }
                if(i==n && ma[i]==0){
                  st.push_back('L');
                  c++;
                }
                else if(i==n && ma[i]>0){
                    st.push_back('L');
                }
                if(i==1 && ma[i]==0){
                    c++;
                }
            }
            if(c==n){
                break;
            }
        }
    }
    cout<<st<<endl;

}


/*Mrc01*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#define ll long long
#define ull unsigned long long
#define f(i,x,n) for(ll int i=x;i<n;i++)
#define re(j,x,n) for(ll int j=x;j>=n;j--)
#define f1(k,x,n) for(ll int k=x;k<=n;k++)
#define endl "\n"
#define mp make_pair
#define pb push_back
#define bit(x, i) (x >>(i - 1) & 1ll)
#define MAX 1000001
const int mod=1000000007;
using namespace __gnu_pbds;
using namespace std;
typedef tree<pair<ll int,ll int>,null_type, less<pair<ll int,ll int>>, rb_tree_tag,tree_order_statistics_node_update>
      new_data_set;
vector<ll int > v[1000100],check;
ll int a[1000010],vis[1000100];

void solve()
{
   ll int n;
    cin>>n;
   ll int a[n];
   f(i,0,n)
     cin>>a[i];
   f(i,0,n)
   {
     while(a[i]--)
     {
       cout<<"P";
     }
     if(i!=n-1)
     cout<<"R";
   }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    // ll int t;
    //  cin>>t;
    // while(t--)
    {
       solve();
    }
}


/*Mrc01*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#define ll long long
#define ull unsigned long long
#define f(i,x,n) for(ll int i=x;i<n;i++)
#define re(j,x,n) for(ll int j=x;j>=n;j--)
#define f1(k,x,n) for(ll int k=x;k<=n;k++)
#define endl "\n"
#define mp make_pair
#define pb push_back
#define bit(x, i) (x >>(i - 1) & 1ll)
#define MAX 1000001
const int mod=1000000007;
using namespace __gnu_pbds;
using namespace std;
typedef tree<pair<ll int,ll int>,null_type, less<pair<ll int,ll int>>, rb_tree_tag,tree_order_statistics_node_update>
      new_data_set;
vector<ll int > v[1000100],check;
ll int a[1000010],vis[1000100];

void solve()
{
   ll int n;
    cin>>n;
   ll int a[n],b[n];
   memset(b,0,sizeof(b));
   f(i,0,n)
     cin>>a[i];
   while(1)
   {
     f(i,0,n)
     {
       if(a[i]!=b[i])
       {
         cout<<"P";
         b[i]++;
       }
       if(i!=n-1)
       cout<<"R";
       else
        cout<<"LR";
     }
     re(i,n-1,0)
     {
       if(a[i]!=b[i])
       {
         cout<<"P";
         b[i]++;
       }
       if(i!=0)
       cout<<"L";
       else
        cout<<"RL";
     }
     ll int f=0;
     f(i,0,n)
     {
       if(a[i]!=b[i])
       {
         f=1;
         break;
       }
     }
     if(f==0)
      break;
   }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    // ll int t;
    //  cin>>t;
    // while(t--)
    {
       solve();
    }
}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
using namespace std;
#define ll long long
#define mp make_pair
#define X first
#define Y second
const int N=308;
int n,a[N];
int main(void)
{
	int i;
	scanf("%d",&n);
	for(i=1;i<=n;i++)scanf("%d",a+i);
	for(i=2;i<=n;i+=2)
	{
		while(a[i-1]||a[i])
		{
			if(a[i-1]){a[i-1]--;printf("P");}
			printf("R");
			if(a[i]){a[i]--;printf("P");}
			printf("L");
		}
		printf("R");
		if(i+1<=n)printf("R");
	}
	if(n&1)
	while(a[n])
	{
		a[n]--;
		printf("PLR");
	}
	return 0;
}


#include <iostream>
using namespace std;
const int N=302;
int n,a[N];

int main() {
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
    int now=1;

    while(1) {
        for(int i=1;i<n;i++){
            if(a[i]) printf("P"), a[i]--;
            printf("R");
        }
        for(int i=n;i>=2;i--){
            if(a[i]) printf("P"), a[i]--;
            printf("L");
        }
        bool ok=1;
        for(int i=1;i<=n;i++) if(a[i]) ok=0;
        if(ok) return 0;
    }
}


#include<iostream>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
using namespace std;
#define ll long long
#define mp make_pair
#define X first
#define Y second
const int N=308;
int n,a[N];
int main(void)
{
	int i;
	scanf("%d",&n);
	for(i=1;i<=n;i++)scanf("%d",a+i);
	for(i=2;i<=n;i+=2)
	{
		while(a[i-1]||a[i])
		{
			if(a[i-1]){a[i-1]--;printf("P");}
			printf("R");
			if(a[i]){a[i]--;printf("P");}
			printf("L");
		}
		printf("R");
		if(i+1<=n)printf("R");
	}
	if(n&1)
	while(a[i])
	{
		a[i]--;
		printf("PLR");
	}
	return 0;
}


#include <bits/stdc++.h>
#define roflan ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ld long double
#define int long long
using namespace std;

signed main(){
  roflan;
  int n;
  cin >> n;
  vector <int> a(n);
  for (int i = 0; i < n; i++){
    cin >> a[i];
  }
  vector <char> ans;
  if (a[0]){
    ans.push_back('P');
    a[0]--;
    while (a[0]){
      ans.push_back('R');
      ans.push_back('L');
      ans.push_back('P');
      a[0]--;
    }
  }
  ans.push_back('R');
  for (int i = 1; i < n; i++){
    if (!a[i]){
      if (i != n - 1)
      ans.push_back('R');
    }
    else{
      ans.push_back('P');
      a[i]--;
      while (a[i]){
        ans.push_back('L');
        ans.push_back('R');
        ans.push_back('P');
        a[i]--;
      }
      ans.push_back('R');
    }
  }
  assert((int)ans.size() <= (int)1e6);
  for (int i = 0; i < ans.size(); i++){
    cout << ans[i];
  }
  return 0;
}


#include <bits/stdc++.h>
#define roflan ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ld long double
#define int long long
using namespace std;

signed main(){
  roflan;
  int n;
  cin >> n;
  vector <int> a(n);
  for (int i = 0; i < n; i++){
    cin >> a[i];
  }
  vector <char> ans;
  if (a[0]){
    ans.push_back('P');
    a[0]--;
    while (a[0]){
      ans.push_back('R');
      ans.push_back('L');
      ans.push_back('P');
      a[0]--;
    }
  }
  ans.push_back('R');
  for (int i = 1; i < n; i++){
    if (!a[i]){
      if (i != n - 1)
      ans.push_back('R');
    }
    else{
      ans.push_back('P');
      a[i]--;
      while (a[i]){
        ans.push_back('L');
        ans.push_back('R');
        ans.push_back('P');
        a[i]--;
      }
      if (i != n - 1)
      ans.push_back('R');
    }
  }
  assert((int)ans.size() <= (int)1e6);
  for (int i = 0; i < ans.size(); i++){
    cout << ans[i];
  }
  return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin>>n;
	vector<int> t(n);
	for(int i=0;i<n;++i) {
		cin>>t[i];
	}

	for(int i=0;i<n;++i) {
		while(t[i]>0) {
			cout<<"P";
			t[i]--;
			if(i+1<n) {
				cout<<"R";
				if(t[i+1]>0) {
					t[i+1]--;
					cout<<"P";
				}
				cout<<"L";
			}else {
				cout<<"LR";
			}
		}
		if(i!=n-1) cout<<"R";
	}
}


#include<bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin>>n;
	vector<int> t(n);
	for(int i=0;i<n;++i) {
		cin>>t[i];
	}

	for(int i=0;i<n;++i) {
		while(t[i]>0) {
			cout<<"P";
			t[i]--;
			if(i+1<n) {
				cout<<"R";
				if(t[i+1]>0) {
					t[i+1]--;
					cout<<"P";
				}
				cout<<"L";
			}else {
				cout<<"LR";
			}
		}
		cout<<"R";
	}
}


#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define pb push_back
#define fr(i,n)	for(i=0;i<n;i++)
#define fe(i,n)	for(i=1;i<=n;i++)
#define ll long long

int main()
{
	std::ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	//ll tt;	cin>>tt;	while(tt--)
	{
		ll n,i,c,sum;
		cin>>n;

		ll arr[n+1];
		fr(i,n)	cin>>arr[i];
		string ans;
		ans="";

		for(i=0;i<n-1;)
		{
			if(arr[i]==0)	{ans+="R";i++;continue;}
			else if(arr[i]>0)
			{
				ans+="P";
				arr[i]--;
			}

			if(arr[i]>0)
			{
				if(arr[i+1]>0)
				{
					ans+="RPL";
					arr[i+1]--;
				}
				else	ans+="LR";
			}
			else	{ans+="R";}
			if(arr[i]==0)	i++;
		}

		while(arr[n-1])
		{
			if(arr[n-1]>0)
			{
				ans+="P";
				arr[n-1]--;
			}

			if(arr[n-1]>0)
			{
				ans+="LR";
			}
		}

		cout<<ans;

	}
	cerr<<" Execution : "<<(1.0*clock())/CLOCKS_PER_SEC<<"s \n";

return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define pb push_back
#define fr(i,n)	for(i=0;i<n;i++)
#define fe(i,n)	for(i=1;i<=n;i++)
#define ll long long

int main()
{
	std::ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	//ll tt;	cin>>tt;	while(tt--)
	{
		ll n,i,c,sum;
		cin>>n;

		ll arr[n+1];
		fr(i,n)	cin>>arr[i];
		string ans;
		ans="";

		for(i=0;i<n-1;)
		{
			if(arr[i]==0)	{ans+="R";i++;continue;}
			else if(arr[i]>0)
			{
				ans+="P";
				arr[i]--;
			}

			if(arr[i]>0)
			{
				if(arr[i+1]>0)
				{
					ans+="RPL";
					arr[i+1]--;
				}
				else	ans+="RL";
			}
			else	{ans+="R";}
			if(arr[i]==0)	i++;
		}

		while(arr[n-1])
		{
			if(arr[n-1]>0)
			{
				ans+="P";
				arr[n-1]--;
			}

			if(arr[n-1]>0)
			{
				ans+="LR";
			}
		}

		cout<<ans;

	}
	cerr<<" Execution : "<<(1.0*clock())/CLOCKS_PER_SEC<<"s \n";

return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define pb push_back
#define fr(i,n)	for(i=0;i<n;i++)
#define fe(i,n)	for(i=1;i<=n;i++)
#define ll long long

int main()
{
	std::ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	//ll tt;	cin>>tt;	while(tt--)
	{
		ll n,i,c,sum;
		cin>>n;

		ll arr[n+1];
		fr(i,n)	cin>>arr[i];
		string ans;
		ans="";

		for(i=0;i<n-1;)
		{
			if(arr[i]==0)	{ans+="R";i++;continue;}
			else if(arr[i]>0)
			{
				ans+="P";
				arr[i]--;
			}

			if(arr[i]>0)
			{
				if(arr[i+1]>0)
				{
					ans+="RPL";
					arr[i+1]--;
				}
				else	ans+="LR";
			}
			else	{ans+="R";i++;}
		}

		while(arr[n-1])
		{
			if(arr[n-1]>0)
			{
				ans+="P";
				arr[n-1]--;
			}

			if(arr[n-1]>0)
			{
				ans+="LR";
			}
		}

		cout<<ans;

	}
	cerr<<" Execution : "<<(1.0*clock())/CLOCKS_PER_SEC<<"s \n";

return 0;
}


#include<bits/stdc++.h>
#define mod 1000000007
#define mod1 998244353
#define Mmax 1000005
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long int li;
typedef unsigned long long int ull;
using namespace std;
bool sortbysec(const pair<li,li>&a,const pair<li,li>&b)
{
    return (a.second<b.second);
}
bool sortbys(pair<char,li>a,pair<char,li>b){
  return a.second<b.second;
}
bool sortby(pair<li,li>a,pair<li,li>b)
{
  if(a.first==b.first)
  return a.second<b.second;
  return a.first<b.first;
}
li mpow(li x,li y)
{
  li ans=1;
  while(y)
  {
    if(y%2!=0)
    ans=(ans%mod)*(x%mod)%mod;
    y/=2;
    x=((x%mod)*(x%mod))%mod;
  }
  return ans;
}
li modInverse(li n)
{
    return mpow(n, mod-2);
}
int main()
{
fast_io
li i,j,n;
cin>>n;
li a[n];
for(i=0;i<n;i++)
cin>>a[i];
string ans="";
for(i=0;i<n;i++)
{
  if(a[i])
  {
    if(i>0)
    {
      while(a[i]--)
      {
        ans+='L';
        ans+='R';
        ans+='P';
      }
    }
    else
    {
      while(a[i]--)
      {
        ans+='R';
        ans+='L';
        ans+='P';
      }
    }
  }
  if(i<n-1)
  ans+='R';
}
cout<<ans;

return 0;
}


#include<bits/stdc++.h>
#define mod 1000000007
#define mod1 998244353
#define Mmax 1000005
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long int li;
typedef unsigned long long int ull;
using namespace std;
bool sortbysec(const pair<li,li>&a,const pair<li,li>&b)
{
    return (a.second<b.second);
}
bool sortbys(pair<char,li>a,pair<char,li>b){
  return a.second<b.second;
}
bool sortby(pair<li,li>a,pair<li,li>b)
{
  if(a.first==b.first)
  return a.second<b.second;
  return a.first<b.first;
}
li mpow(li x,li y)
{
  li ans=1;
  while(y)
  {
    if(y%2!=0)
    ans=(ans%mod)*(x%mod)%mod;
    y/=2;
    x=((x%mod)*(x%mod))%mod;
  }
  return ans;
}
li modInverse(li n)
{
    return mpow(n, mod-2);
}
int main()
{
fast_io
li i,j,n;
cin>>n;
li a[n];
for(i=0;i<n;i++)
cin>>a[i];
string ans="";
for(i=0;i<n;i++)
{
  if(a[i])
  {
    if(i>0)
    {
      while(a[i]--)
      {
        ans+='L';
        ans+='R';
        ans+='P';
      }
    }
    else
    {
      while(a[i]--)
      {
        ans+='R';
        ans+='L';
        ans+='P';
      }
    }
  }
  ans+='R';
}
cout<<ans;

return 0;
}


#include<bits/stdc++.h>
#define mod 1000000007
#define mod1 998244353
#define Mmax 1000005
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long int li;
typedef unsigned long long int ull;
using namespace std;
bool sortbysec(const pair<li,li>&a,const pair<li,li>&b)
{
    return (a.second<b.second);
}
bool sortbys(pair<char,li>a,pair<char,li>b){
  return a.second<b.second;
}
bool sortby(pair<li,li>a,pair<li,li>b)
{
  if(a.first==b.first)
  return a.second<b.second;
  return a.first<b.first;
}
li mpow(li x,li y)
{
  li ans=1;
  while(y)
  {
    if(y%2!=0)
    ans=(ans%mod)*(x%mod)%mod;
    y/=2;
    x=((x%mod)*(x%mod))%mod;
  }
  return ans;
}
li modInverse(li n)
{
    return mpow(n, mod-2);
}
int main()
{
fast_io
li i,j,n;
cin>>n;
li a[n];
for(i=0;i<n;i++)
cin>>a[i];
string ans="";
for(i=0;i<n;i++)
{
  if(a[i])
  {
    if(i>0)
    {
      while(a[i]--)
      {
        ans+='L';
        ans+='R';
        ans+='P';
      }
    }
    else
    {
      while(a[i]--)
      {
        ans+='R';
        ans+='L';
        ans+='P';
      }
    }
  }
  ans+='L';
}
cout<<ans;

return 0;
}


#include<bits/stdc++.h>
#define mod 1000000007
#define mod1 998244353
#define Mmax 1000005
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long int li;
typedef unsigned long long int ull;
using namespace std;
bool sortbysec(const pair<li,li>&a,const pair<li,li>&b)
{
    return (a.second<b.second);
}
bool sortbys(pair<char,li>a,pair<char,li>b){
  return a.second<b.second;
}
bool sortby(pair<li,li>a,pair<li,li>b)
{
  if(a.first==b.first)
  return a.second<b.second;
  return a.first<b.first;
}
li mpow(li x,li y)
{
  li ans=1;
  while(y)
  {
    if(y%2!=0)
    ans=(ans%mod)*(x%mod)%mod;
    y/=2;
    x=((x%mod)*(x%mod))%mod;
  }
  return ans;
}
li modInverse(li n)
{
    return mpow(n, mod-2);
}
int main()
{
fast_io
li i,j,n;
cin>>n;
li a[n];
for(i=0;i<n;i++)
cin>>a[i];
string ans="";
for(i=0;i<n;i++)
{
  if(a[i])
  {
    if(i>0)
    {
      while(a[i]--)
      {
        ans+='L';
        ans+='R';
        ans+='P';
      }
    }
    else
    {
      while(a[i]--)
      {
        ans+='R';
        ans+='L';
        ans+='P';
      }
    }
  }
}
cout<<ans;

return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)
#define ll long long int
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int n; cin>>n;
    vector<int>a(n);
    rep(i,0,n-1) cin>>a[i];
    vector<char>res;
    rep(i,0,n-2)
    {
        if(a[i]==0)
            res.push_back('R');
        else
        {
            rep(j,1,a[i])
            {
                res.push_back('P');
                res.push_back('R');
                res.push_back('L');
            }
            res.push_back('R');
        }
    }
    if(a[n-1]!=0)
    {
        rep(i,1,a[n-1])
        {
            res.push_back('P');
            res.push_back('L');
            res.push_back('R');
        }
    }
    rep(i,0,res.size()-1)
    cout<<res[i]<<" ";
    cout<<"\n";
    return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)
#define ll long long int
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int n; cin>>n;
    vector<int>a(n);
    rep(i,0,n-1) cin>>a[i];
    vector<char>res;
    rep(i,0,n-2)
    {
        if(a[i]==0)
            res.push_back('R');
        else
        {
            rep(j,1,a[i])
            {
                res.push_back('P');
                res.push_back('R');
                res.push_back('L');
            }
            res.push_back('R');
        }
    }
    if(a[n-1]!=0)
    {
        rep(i,1,a[n-1])
        {
            res.push_back('P');
            res.push_back('L');
            res.push_back('R');
        }
    }
    rep(i,0,res.size()-1)
    cout<<res[i];
    cout<<"\n";
    return 0;
}


#include<iostream>
#include<iomanip>
#include<map>
#include<set>
#include<string>
#include<vector>
#include<utility>
#include<cmath>
#include<algorithm>
#include<stack>
#include<unordered_map>
#include<queue>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define sz(c) int((c).size())
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vout(a, n) for (int i = 0; i < n; ++i) printf("%d ", a[i]); printf("\n");

using namespace std;
typedef long long ll;

int n, a;

int main() {
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a;
        if (i != n - 1) cout << string("PRL", a);
        else cout << string("PLR", a);
        cout << "R";
    }

}


#include<iostream>
#include<iomanip>
#include<map>
#include<set>
#include<string>
#include<vector>
#include<utility>
#include<cmath>
#include<algorithm>
#include<stack>
#include<unordered_map>
#include<queue>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define sz(c) int((c).size())
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vout(a, n) for (int i = 0; i < n; ++i) printf("%d ", a[i]); printf("\n");

using namespace std;
typedef long long ll;

int n, a;

int main() {
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a;
        if (i != n - 1) {
            while (a--) cout << "PRL";
        }
        else {
            while (a--) cout << "PLR";
        }
        if (i != n - 1) cout << "R";
    }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int *a=new int[n];
  long long int sum=0;
  for(int i=0;i<n;i++)
  {
      cin>>a[i];
      sum=sum+a[i];
  }
  string ans="";
  while(sum>0)
  {
  for(int i=0;i<n-1;i=i+1)
  {
      if(a[i]==0)
      {
          cout<<'R';
      }
      else if(a[i]!=0)
      {
          a[i]=a[i]-1;
          cout<<"PR";
          sum=sum-1;
      }
  }
  for(int i=n-1;i>0;i--)
      {
        if(a[i]==0)
        {
          cout<<"L";
        }
         else
        {
           a[i]=a[i]-1;
           cout<<"PL";
          sum=sum-1;
        }
      }
  }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int *a=new int[n];
  long long int sum=0;
  for(int i=0;i<n;i++)
  {
      cin>>a[i];
      sum=sum+a[i];
  }
  string ans="";
  while(sum>0)
  {
  for(int i=0;i<n-1;i=i+1)
  {
      if(a[i]==0)
      {
          ans=ans+'R';
      }
      else if(a[i]!=0)
      {
          a[i]=a[i]-1;
          ans=ans+"PR";
          sum=sum-1;
      }
  }
  for(int i=n-1;i>0;i--)
      {
        if(a[i]==0)
        {
          ans=ans+'L';
        }
         else
        {
           a[i]=a[i]-1;
          ans=ans+"PL";
          sum=sum-1;
        }
      }
  }
  cout<<ans;
}


#include<cstdio>
#include<cstring>
#include<iostream>
#include<map>
#include<vector>
using namespace std;
#include<algorithm>
const int Max=2e5+10;
int dx[8]= {-1,-1,-1,0,0,1,1,1};
int dy[8]= {-1,0,1,-1,1,-1,0,1};
int a[Max];
int main()
{
    int n,pos;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
    {
        scanf("%d",&a[i]);
        if(a[i])
            pos=i;
    }
    for(int i=0; i<pos; i++)
    {
        if(a[i])
        {
            printf("PR");
            a[i]--;
        }
        //RPRLPRRPLRP
        else printf("R");
        while(a[i])
        {
            if(a[i+1])
            {
                printf("P");
                a[i+1]--;
            }
            printf("L");
            printf("PR");
            a[i]--;
        }
    }
    if(a[pos])
    {
        printf("P");
        a[pos]--;
    }
    while(a[pos])
    {
        printf("LRP");
        a[pos]--;
    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<iostream>
#include<map>
#include<vector>
using namespace std;
#include<algorithm>
const int Max=2e5+10;
int dx[8]= {-1,-1,-1,0,0,1,1,1};
int dy[8]= {-1,0,1,-1,1,-1,0,1};
int a[Max];
int main()
{
    int n,pos;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
    {
        scanf("%d",&a[i]);
        if(a[i])
            pos=i;
    }
    for(int i=0; i<pos; i++)
    {
        if(a[i])
        {
            printf("PR");
            a[i]--;
        }
        //RPRLPRRPLRP
        else
            printf("R");
        while(a[i])
        {
            if(a[i+1])
            {
                printf("P");
                a[i+1]--;
            }
            printf("L");
            printf("PR");
            a[i]--;
        }
    }
    if(a[pos])
    {
        printf("P");
        a[pos]--;
    }
    if(pos==0)
    {
        while(a[pos])
        {
            printf("RLP");
            a[pos]--;
        }
    }
    else
    {
        while(a[pos])
        {
            printf("LRP");
            a[pos]--;
        }
    }
    return 0;
}


#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include <initializer_list>
#include<unordered_set>
#include<map>
#include<cmath>
#include <iterator>
#include<stack>
#include<queue>
#include <iomanip>
#include<math.h>
#include <limits.h>
#include <numeric>
#include <functional>
#include<fstream>
using namespace std;
void past_code();

#define mod 300002
#define ll  long long

int main(){
	ios_base::sync_with_stdio(false);
	int x,y;
	cin>>x;
	for (int i=0;i<x-1;i++)
	{
		cin>>y;
		while (y--)
		{
			cout<<"PRL";
		}
		cout<<"R";
	}
	cin>>y;
	while (y--)
	{
		cout<<"PLR";
	}
	cout<<endl;
	return 0;
}


#include<stdio.h>
int main()
{
    int i, j, n, a[500];
    bool ok = true;
    scanf("%d", &n);
    for(i=0; i<n; i++)
        scanf("%d", &a[i]);
    int time = 0;
    i=0;
    while(ok)
    {
        if(a[i] == 0 && time == 0 && i<n-1)
        {
            printf("R");
            i++;
            continue;
            time = 0;
        }
        if(time == 0 && a[i]>0)
        {
            printf("P");
            a[i] --;
            time = 1;
            continue;

        }
        if(time == 1 && a[i]>0)
        {
            if(i>0)
            {
                printf("LRP");
                a[i]--;
                time = 1;
                continue;
            }
            else
                if(i<n-1)
                {
                    printf("RLP");
                    a[i]--;
                    time = 1;
                    continue;
                }
        }
        if(a[i] == 0 && i!=n-1)
        {
            printf("R");
            i++;
            time = 0;
            continue;
        }
        else
            break;
    }
    printf("\n");
    //scanf("%d", &n);
    return 0;
}


#include<stdio.h>
int main()
{
    int i, j, n, a[500];
    bool ok = true;
    scanf("%d", &n);
    for(i=0; i<n; i++)
        scanf("%d", &a[i]);
    int time = 0;
    i=0;
    while(ok)
    {
        if(a[i] == 0 && time == 0)
        {
            printf("R");
            i++;
            continue;
            time = 0;
        }
        if(time == 0 && a[i]>0)
        {
            printf("P");
            a[i] --;
            time = 1;
            continue;

        }
        if(time == 1 && a[i]>0)
        {
            if(i>0)
            {
                printf("LRP");
                a[i]--;
                time = 1;
                continue;
            }
            else
                if(i<n-1)
                {
                    printf("RLP");
                    a[i]--;
                    time = 1;
                    continue;
                }
        }
        if(a[i] == 0 && i!=n-1)
        {
            printf("R");
            i++;
            time = 0;
            continue;
        }
        else
            break;
    }
    printf("\n");
    //scanf("%d", &n);
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<algorithm>
#include<set>
#include<map>
#include<utility>
#include<vector>
#include<string>
#include<stack>
#include<queue>
using namespace std;
#define MAXN 306
int array[MAXN];
int main()
{
    //freopen("data.txt", "r", stdin);
    int N,i,s;
    while (scanf("%d", &N) != EOF)
    {
        s = 0;
        for (i=1; i<=N; ++i)
        {
            scanf("%d", &array[i]);
            s += array[i];
        }
        if (array[1])
        {
            putchar('P');
            putchar('R');
            --array[1];
            while (array[1])
            {
                putchar('L');
                putchar('P');
                putchar('R');
                --array[1];
            }
        }
        else putchar('R');
        for (i=2; i<=N; ++i)
        {
            if (array[i] == 0)
            {
                if (i < N) putchar('R');
                continue;
            }
            while (array[i])
            {
                putchar('P');
                putchar('L');
                putchar('R');
                --array[i];
            }
            if (i < N) putchar('R');
        }
        puts("");
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<algorithm>
#include<set>
#include<map>
#include<utility>
#include<vector>
#include<string>
#include<stack>
#include<queue>
using namespace std;
#define MAXN 306
int array[MAXN];
int main()
{
    //freopen("data.txt", "r", stdin);
    int N,i,s;
    while (scanf("%d", &N) != EOF)
    {
        s = 0;
        for (i=1; i<=N; ++i)
        {
            scanf("%d", &array[i]);
            s += array[i];
        }
        if (array[1])
        {
            putchar('P');
            putchar('R');
            --array[1];
            while (array[1])
            {
                putchar('L');
                putchar('P');
                putchar('R');
                --array[1];
            }
        }
        else putchar('R');
        for (i=2; i<=N; ++i)
        {
            if (array[i] == 0)
            {
                putchar('R');
                continue;
            }
            while (array[i])
            {
                putchar('P');
                putchar('L');
                putchar('R');
                --array[i];
            }
            if (i < N) putchar('R');
        }
        puts("");
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<algorithm>
#include<set>
#include<map>
#include<utility>
#include<vector>
#include<string>
#include<stack>
#include<queue>
using namespace std;
#define MAXN 306
int array[MAXN];
int main()
{
    //freopen("data.txt", "r", stdin);
    int N,i,s;
    while (scanf("%d", &N) != EOF)
    {
        s = 0;
        for (i=1; i<=N; ++i)
        {
            scanf("%d", &array[i]);
            s += array[i];
        }
        if (array[1])
        {
            putchar('P');
            putchar('R');
            --array[1];
            while (array[1])
            {
                putchar('L');
                putchar('P');
                putchar('R');
                --array[1];
            }
        }
        else putchar('R');
        for (i=2; i<=N; ++i)
        {
            if (array[i] == 0)
            {
                putchar('R');
                putchar('R');
                continue;
            }
            while (array[i])
            {
                putchar('P');
                putchar('L');
                putchar('R');
                --array[i];
            }
            if (i < N) putchar('R');
        }
        puts("");
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<algorithm>
#include<set>
#include<map>
#include<utility>
#include<vector>
#include<string>
#include<stack>
#include<queue>
using namespace std;
#define MAXN 306
int array[MAXN];
int main()
{
    //freopen("data.txt", "r", stdin);
    int N,i,s;
    while (scanf("%d", &N) != EOF)
    {
        s = 0;
        for (i=1; i<=N; ++i)
        {
            scanf("%d", &array[i]);
            s += array[i];
        }
        if (array[1])
        {
            putchar('P');
            putchar('R');
            --array[1];
            while (array[1])
            {
                putchar('L');
                putchar('P');
                putchar('R');
                --array[1];
            }
        }
        else putchar('R');
        for (i=2; i<=N; ++i)
        {
            if (array[i] == 0)
            {
                putchar('R');
                continue;
            }
            while (array[i])
            {
                putchar('P');
                putchar('L');
                putchar('R');
                --array[i];
            }
        }
        puts("");
    }
    return 0;
}


#include <stdio.h>

int N,A;

int main()
{
    int i;

    scanf ("%d",&N);
    for (i=0;i<N;i++){
        scanf ("%d",&A);
        while (A){
            putchar('P');
            A--;
            if (A == 0) break;
            else if (i+1 < N) printf ("RL");
            else printf ("LR");
        }
        if (i+1<N) putchar('R');
    }

    return 0;
}


#include <stdio.h>

int N,A;

int main()
{
    int i;

    scanf ("%d",&N);
    for (i=0;i<N;i++){
        scanf ("%d",&A);
        while (A){
            putchar('P');
            A--;
            if (A == 0 && i+1 < N) putchar('R');
            else if (i+1 < N) printf ("RL");
            else printf ("LR");
        }
    }

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <limits>
using namespace std;

// Types
typedef long long int64;
typedef unsigned long long uint64;
typedef pair<int,int> ipair;
const double pi=acos(-1.0);
const double eps=1e-11;

// Generic
#define SIZE(X) ((int)(X.size()))
#define LENGTH(X) ((int)(X.length()))
#define MP(X,Y) make_pair(X,Y)
#define FORD(i, a, b) for(int i=(a); i<(b); i++)
#define FORS(i, a) for(int i=(0); i<SIZE(a); i++)
#define two(X) (1<<(X))
#define twoL(X) (((int64)(1))<<(X))
template<class T> inline T sqr(T x){return x*x;}

// Bit manipulation
template<class T> void setbit(T& v, int position)    { v |= (T)1 << position; }
template<class T> void unsetbit(T& v, int position)  { v &= ~((T)1 << position); }
template<class T> void togglebit(T& v, int position) { v ^= (T)1 << position; }
template<class T> bool isbit(T v, int position) { return (v & ((T)1 << position)) != 0; }
template<class T> inline int countbit(T n){return (n==0)?0:(1+countbit(n&(n-1)));}

// Input / Output
string ReadToEndLine(istream& s) { string sLine; getline(s, sLine); return sLine; }
char gStr[1024];
// sprintf_s(gStr, "%d", );

struct Runner
{
	Runner(istream& in, ostream& out) : mIn(in), mOut(out) {}
	void Run();
	istream& mIn; ostream& mOut;
};

void Runner::Run()
{
	int N, a;
	mIn >> N;

	string res;
	FORD(i, 0, N)
	{
		if(i != 0)
			res += "R";
		mIn >> a;
		FORD(j, 0, a)
			res+= "P";
	}

	mOut << res.c_str() <<endl;
}

#ifndef LOCAL
int main()
{
	Runner runner(cin, cout);
	runner.Run();
	return 0;
}
#endif

#ifdef LOCAL // Local testing. Nothing solution related
bool checkCase(const vector<string>& ok, const vector<string>& my)
{
	bool bSuccess = ok.size() == my.size();
	if(bSuccess)
	{
		for(size_t i=0; i<ok.size(); ++i)
			if(ok[i] != my[i])
				bSuccess = false;
	}

	cout << (bSuccess ? "Passed" : "Failed") << endl;
	if(!bSuccess)
	{
		bool newLine = ok.size() != 1 || my.size() != 1;
		cout << "expected: "; if(newLine) { cout << endl; }
		for(size_t i=0; i<ok.size(); ++i) { cout << ok[i] << endl; }
		cout << "actual  : "; if(newLine) { cout << endl; }
		for(size_t i=0; i<my.size(); ++i) { cout << my[i] << endl; }
	}
	return bSuccess;
}

vector<string> readFile(istream& s)
{
	vector<string> res; string str;
	while (s && !s.eof())
	{
		getline(s, str);
		if(str.find("--case") == 0)
			break;
		res.push_back(str);
	}
	if(res.size() > 0 && res.back().empty())
		res.resize(res.size()-1);
	return res;
}

vector<string> readFile(const string str)
{
	istringstream ssStr(str);
	return readFile(ssStr);
}

string joinLines(const vector<string>& lines)
{
	ostringstream res;
	for(size_t i=0; i<lines.size(); ++i)
		res << lines[i] << endl;
	return res.str();
}

void main(int argc, char *argv[])
{
	string pathToFiles = __FILE__;
	pathToFiles.resize(pathToFiles.size() - 4);
	ifstream sIn(pathToFiles + ".in.txt");
	ifstream sOk(pathToFiles + ".ok.txt");
	ofstream sMy(pathToFiles + ".my.txt");

	int index = 0; bool bPassed = true;
	while(sIn)
	{
		++index;
		vector<string> aIn(readFile(sIn)), aOk(readFile(sOk));
		istringstream ssIn(joinLines(aIn));
		ostringstream ssMy;

		cout << "Case " << index << ": ... ";
		Runner runner(ssIn, ssMy);
		runner.Run();

		vector<string> aMy(readFile(ssMy.str()));
		if(!checkCase(aOk, aMy))
			bPassed = false;
		if(index > 1)
			sMy << "--case " << index << endl;
		sMy << joinLines(aMy).c_str();
	}
	cout << "Tests: " << (bPassed ? "Passed" : "Faled") << endl;
	getchar();
}
#endif


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <limits>
using namespace std;

// Types
typedef long long int64;
typedef unsigned long long uint64;
typedef pair<int,int> ipair;
const double pi=acos(-1.0);
const double eps=1e-11;

// Generic
#define SIZE(X) ((int)(X.size()))
#define LENGTH(X) ((int)(X.length()))
#define MP(X,Y) make_pair(X,Y)
#define FORD(i, a, b) for(int i=(a); i<(b); i++)
#define FORS(i, a) for(int i=(0); i<SIZE(a); i++)
#define two(X) (1<<(X))
#define twoL(X) (((int64)(1))<<(X))
template<class T> inline T sqr(T x){return x*x;}

// Bit manipulation
template<class T> void setbit(T& v, int position)    { v |= (T)1 << position; }
template<class T> void unsetbit(T& v, int position)  { v &= ~((T)1 << position); }
template<class T> void togglebit(T& v, int position) { v ^= (T)1 << position; }
template<class T> bool isbit(T v, int position) { return (v & ((T)1 << position)) != 0; }
template<class T> inline int countbit(T n){return (n==0)?0:(1+countbit(n&(n-1)));}

// Input / Output
string ReadToEndLine(istream& s) { string sLine; getline(s, sLine); return sLine; }
char gStr[1024];
// sprintf_s(gStr, "%d", );

struct Runner
{
	Runner(istream& in, ostream& out) : mIn(in), mOut(out) {}
	void Run();
	istream& mIn; ostream& mOut;
};

void Runner::Run()
{
	int N, a;
	mIn >> N;

	string res;
	FORD(i, 0, N)
	{
		if(i != 0)
			res += "R";
		mIn >> a;
		FORD(j, 0, a)
			res+= "P";
	}

	mOut << res.c_str();
}

#ifndef LOCAL
int main()
{
	Runner runner(cin, cout);
	runner.Run();
	return 0;
}
#endif

#ifdef LOCAL // Local testing. Nothing solution related
bool checkCase(const vector<string>& ok, const vector<string>& my)
{
	bool bSuccess = ok.size() == my.size();
	if(bSuccess)
	{
		for(size_t i=0; i<ok.size(); ++i)
			if(ok[i] != my[i])
				bSuccess = false;
	}

	cout << (bSuccess ? "Passed" : "Failed") << endl;
	if(!bSuccess)
	{
		bool newLine = ok.size() != 1 || my.size() != 1;
		cout << "expected: "; if(newLine) { cout << endl; }
		for(size_t i=0; i<ok.size(); ++i) { cout << ok[i] << endl; }
		cout << "actual  : "; if(newLine) { cout << endl; }
		for(size_t i=0; i<my.size(); ++i) { cout << my[i] << endl; }
	}
	return bSuccess;
}

vector<string> readFile(istream& s)
{
	vector<string> res; string str;
	while (s && !s.eof())
	{
		getline(s, str);
		if(str.find("--case") == 0)
			break;
		res.push_back(str);
	}
	if(res.size() > 0 && res.back().empty())
		res.resize(res.size()-1);
	return res;
}

vector<string> readFile(const string str)
{
	istringstream ssStr(str);
	return readFile(ssStr);
}

string joinLines(const vector<string>& lines)
{
	ostringstream res;
	for(size_t i=0; i<lines.size(); ++i)
		res << lines[i] << endl;
	return res.str();
}

void main(int argc, char *argv[])
{
	string pathToFiles = __FILE__;
	pathToFiles.resize(pathToFiles.size() - 4);
	ifstream sIn(pathToFiles + ".in.txt");
	ifstream sOk(pathToFiles + ".ok.txt");
	ofstream sMy(pathToFiles + ".my.txt");

	int index = 0; bool bPassed = true;
	while(sIn)
	{
		++index;
		vector<string> aIn(readFile(sIn)), aOk(readFile(sOk));
		istringstream ssIn(joinLines(aIn));
		ostringstream ssMy;

		cout << "Case " << index << ": ... ";
		Runner runner(ssIn, ssMy);
		runner.Run();

		vector<string> aMy(readFile(ssMy.str()));
		if(!checkCase(aOk, aMy))
			bPassed = false;
		if(index > 1)
			sMy << "--case " << index << endl;
		sMy << joinLines(aMy).c_str();
	}
	cout << "Tests: " << (bPassed ? "Passed" : "Faled") << endl;
	getchar();
}
#endif


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <limits>
using namespace std;

// Types
typedef long long int64;
typedef unsigned long long uint64;
typedef pair<int,int> ipair;
const double pi=acos(-1.0);
const double eps=1e-11;

// Generic
#define SIZE(X) ((int)(X.size()))
#define LENGTH(X) ((int)(X.length()))
#define MP(X,Y) make_pair(X,Y)
#define FORD(i, a, b) for(int i=(a); i<(b); i++)
#define FORS(i, a) for(int i=(0); i<SIZE(a); i++)
#define two(X) (1<<(X))
#define twoL(X) (((int64)(1))<<(X))
template<class T> inline T sqr(T x){return x*x;}

// Bit manipulation
template<class T> void setbit(T& v, int position)    { v |= (T)1 << position; }
template<class T> void unsetbit(T& v, int position)  { v &= ~((T)1 << position); }
template<class T> void togglebit(T& v, int position) { v ^= (T)1 << position; }
template<class T> bool isbit(T v, int position) { return (v & ((T)1 << position)) != 0; }
template<class T> inline int countbit(T n){return (n==0)?0:(1+countbit(n&(n-1)));}

// Input / Output
string ReadToEndLine(istream& s) { string sLine; getline(s, sLine); return sLine; }
char gStr[1024];
// sprintf_s(gStr, "%d", );

struct Runner
{
	Runner(istream& in, ostream& out) : mIn(in), mOut(out) {}
	void Run();
	istream& mIn; ostream& mOut;
};

void Runner::Run()
{
	int N, a;
	mIn >> N;

	string res;
	FORD(i, 0, N)
	{
		if(i != 0)
			res += "R";
		mIn >> a;
		FORD(j, 0, a)
			res+= (i==0) ? "PRL" : "PLR";
	}

	mOut << res.c_str() <<endl;
}

#ifndef LOCAL
int main()
{
	Runner runner(cin, cout);
	runner.Run();
	return 0;
}
#endif

#ifdef LOCAL // Local testing. Nothing solution related
bool checkCase(const vector<string>& ok, const vector<string>& my)
{
	bool bSuccess = ok.size() == my.size();
	if(bSuccess)
	{
		for(size_t i=0; i<ok.size(); ++i)
			if(ok[i] != my[i])
				bSuccess = false;
	}

	cout << (bSuccess ? "Passed" : "Failed") << endl;
	if(!bSuccess)
	{
		bool newLine = ok.size() != 1 || my.size() != 1;
		cout << "expected: "; if(newLine) { cout << endl; }
		for(size_t i=0; i<ok.size(); ++i) { cout << ok[i] << endl; }
		cout << "actual  : "; if(newLine) { cout << endl; }
		for(size_t i=0; i<my.size(); ++i) { cout << my[i] << endl; }
	}
	return bSuccess;
}

vector<string> readFile(istream& s)
{
	vector<string> res; string str;
	while (s && !s.eof())
	{
		getline(s, str);
		if(str.find("--case") == 0)
			break;
		res.push_back(str);
	}
	if(res.size() > 0 && res.back().empty())
		res.resize(res.size()-1);
	return res;
}

vector<string> readFile(const string str)
{
	istringstream ssStr(str);
	return readFile(ssStr);
}

string joinLines(const vector<string>& lines)
{
	ostringstream res;
	for(size_t i=0; i<lines.size(); ++i)
		res << lines[i] << endl;
	return res.str();
}

void main(int argc, char *argv[])
{
	string pathToFiles = __FILE__;
	pathToFiles.resize(pathToFiles.size() - 4);
	ifstream sIn(pathToFiles + ".in.txt");
	ifstream sOk(pathToFiles + ".ok.txt");
	ofstream sMy(pathToFiles + ".my.txt");

	int index = 0; bool bPassed = true;
	while(sIn)
	{
		++index;
		vector<string> aIn(readFile(sIn)), aOk(readFile(sOk));
		istringstream ssIn(joinLines(aIn));
		ostringstream ssMy;

		cout << "Case " << index << ": ... ";
		Runner runner(ssIn, ssMy);
		runner.Run();

		vector<string> aMy(readFile(ssMy.str()));
		if(!checkCase(aOk, aMy))
			bPassed = false;
		if(index > 1)
			sMy << "--case " << index << endl;
		sMy << joinLines(aMy).c_str();
	}
	cout << "Tests: " << (bPassed ? "Passed" : "Faled") << endl;
	getchar();
}
#endif


#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <stack>
#include <math.h>
#include <vector>
#include <set>
#include <algorithm>
#include <map>
#include <iostream>
#include <string>
#define mp make_pair
#define ll long long
#define pb push_back

using namespace std;

int main()
{
    int n;
    vector <int> a;
    int x,f=0;
    scanf("%d",&n);
    for (int i=0;i<n;i++){
        scanf("%d",&x);
        a.pb(x);
    }
    int pos=0;
    while(1==1){
        if (a[pos]>0){
            printf("P");
            a[pos]--;
            if (pos+1<n){
                printf(a[pos+1]>0 ? "RPL":"RL");
                a[pos+1]--;
            }
            else
                printf("LR");
        }
        else if (pos+1<n){
            printf("R");
            pos++;
        }
        else
            break;
    }

    return 0;
}


#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <stack>
#include <math.h>
#include <vector>
#include <set>
#include <algorithm>
#include <map>
#include <iostream>
#include <string>
#define mp make_pair
#define ll long long
#define pb push_back

using namespace std;

int main()
{
    int n;
    vector <int> a;
    int x;
    scanf("%d",&n);
    for (int i=0;i<n;i++){
        scanf("%d",&x);
        a.pb(x);
    }
    a.pb(0);
    for (int i=0;i<n;i++){
        if (i!=0)
            printf("R");
        if (a[i]>0){
            for (int j=0;a[i]>0;j++){
            printf("P");
            a[i]--;
            if (i<n-1){
                printf("R");
                if (a[i+1]>0){
                    a[i+1]--;
                    printf("PL");
                }
                else
                    printf("L");
            }
            else
                printf("LR");

            }
        }
        else if (i+1<n)
            printf("R");
        else
            break;

    }

    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <vector>

using namespace std;

int a[310];
vector <char> operation;

int main() {
        int N;
        scanf("%d", &N);
        int sum = 0;
        for (int i = 0; i < N; i++) {
                scanf("%d", &a[i]);
                sum += a[i];
        }
        for (int cur = 0; cur < N; cur++) {
                while (a[cur] > 0) {
                        a[cur]--;
                        operation.push_back('P');
                        if (cur + 1 < N) {
                                operation.push_back('R');
                                if (a[cur+1] > 0) {
                                        a[cur+1]--;
                                        if (sum == 0) break;
                                        operation.push_back('P');
                                }
                                operation.push_back('L');
                        }
                        else {
                                operation.push_back('L');
                                operation.push_back('R');
                        }
                }
                if (cur + 1 < N) operation.push_back('R');
        }
        for (int i = 0; i < operation.size(); i++) {
                printf("%c", operation[i]);
        }
        printf("\n");
        return 0;
}


#include <stdio.h>
#include <algorithm>
#include <vector>

using namespace std;

int a[310];
vector <char> operation;

int main() {
        int N;
        scanf("%d", &N);
        int sum = 0;
        for (int i = 0; i < N; i++) {
                scanf("%d", &a[i]);
                sum += a[i];
        }
        for (int cur = 0; cur < N; cur++) {
                while (a[cur] > 0) {
                        a[cur]--;
                        operation.push_back('P');
                        if (cur + 1 < N) {
                                operation.push_back('R');
                                if (a[cur+1] > 0) {
                                        a[cur+1]--;
                                        if (sum == 0) break;
                                        operation.push_back('P');
                                }
                                operation.push_back('L');
                        }
                        else {
                                operation.push_back('L');
                                operation.push_back('R');
                        }
                }
                operation.push_back('R');
        }
        for (int i = 0; i < operation.size(); i++) {
                printf("%c", operation[i]);
        }
        printf("\n");
        return 0;
}


#include <iostream>
#include <map>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

int main()
{
    int n,a;
    string s="";
    vector<int>vec;
    cin>>n;
    for(int x=0;x<n;x++)
    {
        cin>>a;
        vec.push_back(a);
    }
    for(int x=0;x<vec.size();x++)
    {
    if(vec[x]==0 && x!=vec.size()-1)
        s+='R';
    else
    {
        int h=vec[x],A=x+1;
        char R='R',L='L';

        if(x==vec.size()-1)
        {
            R='L';
            L='R';
            A=x-1;
        }

        for(int y=0;y<h;y++)
        {
            if(vec[x]>0)
                s+='P';
            vec[x]--;
            if(vec[x]!=0)
            {
                s+=R;
                if(vec[A]>0)
                {
                    s+='P';
                    vec[A]--;
                }
                s+=L;
            }
        }
        if(x!=vec.size()-1)
            s+=R;
    }
    }
    cout<<s<<endl;
    return 0;
}


#include <iostream>
#include <map>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

int main()
{
    int n,a;
    string s="";
    vector<int>vec;
    cin>>n;
    for(int x=0;x<n;x++)
    {
        cin>>a;
        vec.push_back(a);
    }
    for(int x=0;x<vec.size();x++)
    {
    if(vec[x]==0)
        s+='R';
    else
    {
        int h=vec[x],A=x+1;
        char R='R',L='L';

        if(x==vec.size()-1)
        {
            R='L';
            L='R';
            A=x-1;
        }

        for(int y=0;y<h;y++)
        {
            if(vec[x]>0)
                s+='P';
            vec[x]--;
            if(vec[x]!=0)
            {
                s+=R;
                if(vec[A]>0)
                {
                    s+='P';
                    vec[A]--;
                }
                s+=L;
            }
        }
        if(x!=vec.size()-1)
            s+=R;
    }
    }
    cout<<s<<endl;
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:16777216")
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define REP(i, N) FOR(i, 0, N)
#define RREP(i, N) RFOR(i, N, 0)
#define FILL(A,value) memset(A,value,sizeof(A))

#define ALL(V) V.begin(), V.end()
#define SZ(V) (int)V.size()
#define PB push_back
#define MP make_pair
#define Pi 3.14159265358979

typedef long long Int;
typedef unsigned long long UINT;
typedef vector <int> VI;
typedef pair <int, int> PII;

const int INF = 1000000000;
const int MAX = 400000;
const int MAX2 = 7000;
const int BASE = 1000000000;

int n;
int A[MAX];
string res = "";

int main()
{
    #ifndef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
    #endif

    scanf("%d", &n);
    FOR (i,0,n)
        scanf("%d", &A[i]);
    while (1)
    {
        bool was = 0;
        FOR (i,0,n)
            if (A[i] > 0)
                was = 1;
        if (!was)
            break;
        FOR (i,0,n)
        {
            if (A[i] > 0)
            {
                res += 'P';
                -- A[i];
            }
            if (i != n-1)
                res += 'L';
        }
        RFOR (i,n,0)
        {
            if (A[i] > 0 && i != n-1)
            {
                res += 'P';
                --A[i];
            }
            if (i != 0)
                res += 'R';
        }
    }

    printf("%s\n", res.c_str());

    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:16777216")
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define REP(i, N) FOR(i, 0, N)
#define RREP(i, N) RFOR(i, N, 0)
#define FILL(A,value) memset(A,value,sizeof(A))

#define ALL(V) V.begin(), V.end()
#define SZ(V) (int)V.size()
#define PB push_back
#define MP make_pair
#define Pi 3.14159265358979

typedef long long Int;
typedef unsigned long long UINT;
typedef vector <int> VI;
typedef pair <int, int> PII;

const int INF = 1000000000;
const int MAX = 400000;
const int MAX2 = 7000;
const int BASE = 1000000000;

int n;
int A[MAX];
string res = "";

int main()
{
    #ifndef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
    #endif

    scanf("%d", &n);
    FOR (i,0,n)
        scanf("%d", &A[i]);
    while (1)
    {
        bool was = 0;
        FOR (i,0,n)
            if (A[i] > 0)
                was = 1;
        if (!was)
            break;
        FOR (i,0,n)
        {
            if (A[i] > 0 && i != 0)
            {
                res += 'P';
                -- A[i];
            }
            if (i != n-1)
                res += 'R';
        }
        RFOR (i,n,0)
        {
            if (A[i] > 0 && i != n-1)
            {
                res += 'P';
                --A[i];
            }
            if (i != 0)
                res += 'L';
        }
    }

    printf("%s\n", res.c_str());

    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:16777216")
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define REP(i, N) FOR(i, 0, N)
#define RREP(i, N) RFOR(i, N, 0)
#define FILL(A,value) memset(A,value,sizeof(A))

#define ALL(V) V.begin(), V.end()
#define SZ(V) (int)V.size()
#define PB push_back
#define MP make_pair
#define Pi 3.14159265358979

typedef long long Int;
typedef unsigned long long UINT;
typedef vector <int> VI;
typedef pair <int, int> PII;

const int INF = 1000000000;
const int MAX = 400000;
const int MAX2 = 7000;
const int BASE = 1000000000;

int n;
int A[MAX];
string res = "";

int main()
{
    #ifndef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
    #endif

    scanf("%d", &n);
    FOR (i,0,n)
        scanf("%d", &A[i]);
    while (1)
    {
        bool was = 0;
        FOR (i,0,n)
            if (A[i] > 0)
                was = 1;
        if (!was)
            break;
        FOR (i,0,n)
        {
            if (A[i] > 0)
            {
                res += 'P';
                -- A[i];
            }
            if (i != n-1)
                res += 'R';
        }
        RFOR (i,n,0)
        {
            if (A[i] > 0 && i != n-1)
            {
                res += 'P';
                --A[i];
            }
            if (i != 0)
                res += 'L';
        }
    }

    printf("%s\n", res.c_str());

    return 0;
}


#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
using namespace std;
int a[305];
int n;
char ans[1000010];
int main(){
	while(scanf("%d",&n)!=EOF){
		for(int i=0;i<n;i++)scanf("%d",&a[i]);
		int p=0;
		for(int i=0;i<n;i++){
			while(a[i]){
				if(i){
					ans[p++]='L';
					ans[p++]='R';
					ans[p++]='P';
				}
				else {
					ans[p++]='R';
					ans[p++]='L';
					ans[p++]='P';
				}
				a[i]--;
			}
			ans[p++]='R';
		}
		for(int i=0;i<p;i++)printf("%c",ans[i]);
		printf("\n");
	}
	return 0;
}


#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
using namespace std;
int a[305];
int n;
char ans[1000010];
int main(){
	while(scanf("%d",&n)!=EOF){
		for(int i=0;i<n;i++)scanf("%d",&a[i]);
		int p=0;
		for(int i=0;i<n;i++){
			while(a[i]){
				if(i){
					ans[p++]='L';
					ans[p++]='R';
					ans[p++]='P';
				}
				else {
					ans[p++]='R';
					ans[p++]='L';
					ans[p++]='P';
				}
				a[i]--;
			}
			ans[p++]='R';
		}
		p--;
		for(int i=0;i<p;i++)printf("%c",ans[i]);
		printf("\n");
	}
	return 0;
}


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

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;
		}
	}
	static int gcd(int a, int b)
	{
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}
public static void main(String args[]) throws Exception
{
//  try {
//   FileOutputStream output=new FileOutputStream("C:\\Users\\icons\\Desktop\\java\\output.txt");
//   PrintStream out=new PrintStream(output);
//   //Diverting the output stream into file "temp.out".Comment the below line to use console
//   //System.setOut(out);

//   InputStream input=new FileInputStream("C:\\Users\\icons\\Desktop\\java\\input.txt");
//   //Diverting the input stream into file "temp.in".Comment the below line to use console
//   System.setIn(input);

//  } catch (FileNotFoundException e) {
//   e.printStackTrace();
//  }

  FastReader sc = new FastReader();
  int t=sc.nextInt();
 for(int test=0;test<t;test++){
	long x=sc.nextLong();
	long y=sc.nextLong();
	long k=sc.nextLong();
	long coal=k*y;
	if((coal+k-1)%(x-1)==0){
	System.out.println(k+(coal+k-1)/(x-1));
	}
	else{
		System.out.println(k+((coal+k-1)/(x-1))+1);
	}
}
}

}


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

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;
		}
	}
	static int gcd(int a, int b)
	{
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}
public static void main(String args[]) throws Exception
{
//  try {
//   FileOutputStream output=new FileOutputStream("C:\\Users\\icons\\Desktop\\java\\output.txt");
//   PrintStream out=new PrintStream(output);
//   //Diverting the output stream into file "temp.out".Comment the below line to use console
//   //System.setOut(out);

//   InputStream input=new FileInputStream("C:\\Users\\icons\\Desktop\\java\\input.txt");
//   //Diverting the input stream into file "temp.in".Comment the below line to use console
//   System.setIn(input);

//  } catch (FileNotFoundException e) {
//   e.printStackTrace();
//  }

  FastReader sc = new FastReader();
  int t=sc.nextInt();
 for(int test=0;test<t;test++){
	long x=sc.nextLong();
	long y=sc.nextLong();
	long k=sc.nextLong();
	long coal=k*y;
	if(coal%(x-1)==0 || ((k-1)%(x-1)==0)){
	System.out.println((long)Math.ceil(coal/(x-1))+(long)Math.ceil((k-1)/(x-1)));
	}
	else{
		System.out.println((long)Math.ceil((coal+k-1)/(x-1)));
	}
}
}

}


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

public class A {
	static final FastReader in = new FastReader();
	static final PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) {
		int t = in.nextInt();
		while((t--)>0) {
			long x = in.nextInt(), y = in.nextInt(), k =in.nextInt();
			out.println((k*(y+1)-1+(x-2))/(x-1) + k);
		}
		out.close();
	}

	static long power(long a, long b, int mod) {
		if (b == 0)
			return 1;

		long res = power(a, b / 2, mod);
		res = res * res % mod;
		if (b % 2 == 1)
			res = res * a % mod;
		return res;
	}

	static class Pair implements Comparable<Pair> {
		public int x;
		public int y;

		public Pair(int x, int y) {
			this.x = x;
			this.y = y;
		}

		@Override
		public int compareTo(Pair o) {
			if (x == o.x)
				return Integer.compare(y, o.y);

			return Integer.compare(x, o.x);
		}

		@Override
		public String toString() {
			String val = "(" + x + "," + y + ")";
			return val;
		}

		@Override
		public int hashCode() {
			return 31 * x + y;
		}

		@Override
		public boolean equals(Object o) {
			if (this == o)
				return true;
			if (o == null)
				return false;
			if (this.getClass() != o.getClass())
				return false;

			Pair p = (Pair) o;
			return (x == p.x && y == p.y);
		}
	}

	static int[] readIntArray(int n) {
		int a[] = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = in.nextInt();
		return a;
	}

	static long[] readLongArray(int n) {
		long a[] = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = in.nextLong();
		return a;
	}

	static int[][] readIntMat(int n, int m) {
		int[][] a = new int[n][m];
		for (int i = 0; i < n; i++)
			for (int j = 0; j < m; j++)
				a[i][j] = in.nextInt();

		return a;
	}

	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;
		}
	}
}


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

public class A {
	static final FastReader in = new FastReader();
	static final PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) {
		int t = in.nextInt();
		while((t--)>0) {
			long x = in.nextInt(), y = in.nextInt(), k =in.nextInt();
			out.println((k*(y+1)-1)/(x-1));
		}
		out.close();
	}

	static long power(long a, long b, int mod) {
		if (b == 0)
			return 1;

		long res = power(a, b / 2, mod);
		res = res * res % mod;
		if (b % 2 == 1)
			res = res * a % mod;
		return res;
	}

	static class Pair implements Comparable<Pair> {
		public int x;
		public int y;

		public Pair(int x, int y) {
			this.x = x;
			this.y = y;
		}

		@Override
		public int compareTo(Pair o) {
			if (x == o.x)
				return Integer.compare(y, o.y);

			return Integer.compare(x, o.x);
		}

		@Override
		public String toString() {
			String val = "(" + x + "," + y + ")";
			return val;
		}

		@Override
		public int hashCode() {
			return 31 * x + y;
		}

		@Override
		public boolean equals(Object o) {
			if (this == o)
				return true;
			if (o == null)
				return false;
			if (this.getClass() != o.getClass())
				return false;

			Pair p = (Pair) o;
			return (x == p.x && y == p.y);
		}
	}

	static int[] readIntArray(int n) {
		int a[] = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = in.nextInt();
		return a;
	}

	static long[] readLongArray(int n) {
		long a[] = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = in.nextLong();
		return a;
	}

	static int[][] readIntMat(int n, int m) {
		int[][] a = new int[n][m];
		for (int i = 0; i < n; i++)
			for (int j = 0; j < m; j++)
				a[i][j] = in.nextInt();

		return a;
	}

	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;
		}
	}
}


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

public class A {
	static final FastReader in = new FastReader();
	static final PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) {
		int t = in.nextInt();
		while((t--)>0) {
			long x = in.nextInt(), y = in.nextInt(), k =in.nextInt();
			int extra = 0;
			if(x >= k) extra++;
			out.println((k*(y+1)-1)/(x-1) + k + extra);
		}
		out.close();
	}

	static long power(long a, long b, int mod) {
		if (b == 0)
			return 1;

		long res = power(a, b / 2, mod);
		res = res * res % mod;
		if (b % 2 == 1)
			res = res * a % mod;
		return res;
	}

	static class Pair implements Comparable<Pair> {
		public int x;
		public int y;

		public Pair(int x, int y) {
			this.x = x;
			this.y = y;
		}

		@Override
		public int compareTo(Pair o) {
			if (x == o.x)
				return Integer.compare(y, o.y);

			return Integer.compare(x, o.x);
		}

		@Override
		public String toString() {
			String val = "(" + x + "," + y + ")";
			return val;
		}

		@Override
		public int hashCode() {
			return 31 * x + y;
		}

		@Override
		public boolean equals(Object o) {
			if (this == o)
				return true;
			if (o == null)
				return false;
			if (this.getClass() != o.getClass())
				return false;

			Pair p = (Pair) o;
			return (x == p.x && y == p.y);
		}
	}

	static int[] readIntArray(int n) {
		int a[] = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = in.nextInt();
		return a;
	}

	static long[] readLongArray(int n) {
		long a[] = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = in.nextLong();
		return a;
	}

	static int[][] readIntMat(int n, int m) {
		int[][] a = new int[n][m];
		for (int i = 0; i < n; i++)
			for (int j = 0; j < m; j++)
				a[i][j] = in.nextInt();

		return a;
	}

	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;
		}
	}
}


import java.util.*;
public class Codeforces{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
		for(int i=0;i<t;i++) {
			long x=sc.nextLong();
			long y=sc.nextLong();
			long k=sc.nextLong();
			long trades=(long) Math.ceil(((double)(y*k+k-x))/((double)(x-1)));
			trades+=k+1;
			System.out.println(trades);
		}
	}
}


import java.util.*;
public class Codeforces{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
		for(int i=0;i<t;i++) {
			long x=sc.nextLong();
			long y=sc.nextLong();
			long k=sc.nextLong();
			long trades= ((y*k)+k-1)/(x-1);
			if((x-1)*trades<(y*k)+k-1) trades+=1;
			trades+=k;
			System.out.println(trades);
		}
	}
}


import java.util.Scanner;

public class Mandar {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for(int i =0;i<n;i++){
		    int x = sc.nextInt();
		    int y=sc.nextInt();
		    int k=sc.nextInt();
		    System.out.println(((y + 1) * k - 1 + x - 2)); // (x - 1) + k)
		}
	}
}


import java.util.Scanner;

public class Mandar {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for(int i =0;i<n;i++){
		    int x = sc.nextInt();
		    int y=sc.nextInt();
		    int k=sc.nextInt();
		    System.out.println(((y + 1) * k - 1 + x - 2)/ (x - 1) + k);
		}
	}
}


import java.util.Scanner;

public class Mandar {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for(int i =0;i<n;i++){
		    int x = sc.nextInt();
		    int y=sc.nextInt();
		    int k=sc.nextInt();
		    System.out.println(((y + 1) * k - 1 + x - 2))/ (x - 1) + k);
		}
	}
}


import java.util.Scanner;

public class Mandar {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		System.out.println();
		for(int i =0;i<n;i++){
		    long x = sc.nextInt();
		    long y=sc.nextInt();
		    long k=sc.nextInt();
		    System.out.println(((y + 1) * k - 1 + x - 2)/ (x - 1) + k);
		}
	}
}


import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        while (t-->0){
            BigInteger x=sc.nextBigInteger();
            BigInteger y=sc.nextBigInteger();
            BigInteger k=sc.nextBigInteger();
            BigInteger num=y.multiply(k).add(k).subtract(BigInteger.ONE);
            BigInteger ans=(num.add(x).subtract(BigInteger.valueOf(2))).divide(x.subtract(BigInteger.valueOf(1))).add(k);
            System.out.println(ans);

        }
    }
}