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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

const int INF=1001001001001001001ll;

int N;
int U[333],D[333],L[333],R[333];

string fld[333];

vint G[333*333];
int deg[333*333];
signed main(){
    cin>>N;
    rep(i,N)cin>>U[i];
    rep(i,N)cin>>D[i];
    rep(i,N)cin>>L[i];
    rep(i,N)cin>>R[i];

    {
        vint X(N),Y(N);
        rep(i,N)X[i]=U[i]+D[i];
        rep(i,N)Y[i]=N-L[i]-R[i];

        sort(all(X));sort(all(Y));
        int sumX=0;
        int C=INF;
        for(int i=0;i<=N;i++){
            int sumY=0;
            for(int j=0;j<=N;j++){
                chmin(C,sumX+sumY+(N-i)*(N-j));
                if(j<N)sumY+=Y[j];
            }
            if(i<N)sumX+=X[i];
        }
        if(C!=accumulate(all(X),0ll)||Y[0]<0){
            cout<<"NO"<<endl;
            return 0;
        }
    }
    vint u(N),d(N);
    rep(i,N)u[i]=U[i],d[i]=D[i];

    rep(i,N)fld[i]=string(N,'?');

    for(int i=0;i<N;i++){
        vint Y;
        for(int j=i+1;j<N;j++)Y.pb(N-L[j]-R[j]);
        sort(all(Y));
        vint SY(Y.size()+1);
        rep(j,Y.size())SY[j+1]=SY[j]+Y[j];
        vpint uu,dd;
        rep(j,N){
            if(u[j]==0)dd.pb({u[j]+d[j],j});
            else uu.pb({u[j]+d[j],j});
        }
        sort(all(uu));reverse(all(uu));
        sort(all(dd));reverse(all(dd));
        int iu=0,id=0;
        rep(j,N-L[i]-R[i]){
            if(id==dd.size()||(iu!=uu.size()&&uu[iu].fi>=dd[id].fi))iu++;
            else id++;
        }

        while(iu<uu.size()){
            vint X(N);
            rep(j,N)X[j]=u[j]+d[j];
            rep(j,iu+1)X[uu[j].se]--;
            rep(j,id-1)X[dd[j].se]--;
            sort(all(X));
            vint SX(N+1);
            rep(j,N)SX[j+1]=SX[j]+X[j];
            bool ok=true;

            int pos=0;
            for(int j=Y.size();j>=0;j--){
                while(pos<N&&X[pos]<=Y.size()-j)pos++;
                if(SX[pos]+SY[j]+(N-pos)*(Y.size()-j)<SY.back())ok=false;
            }

            if(!ok)break;
            iu++;id--;
        }
        rep(j,iu){
            u[uu[j].se]--;
            fld[i][uu[j].se]='U';
        }
        rep(j,id){
            d[dd[j].se]--;
            fld[i][dd[j].se]='D';
        }
    }

    rep(i,N){
        vint v;
        rep(j,N)if(fld[i][j]=='?')v.pb(j);
        rep(j,L[i])fld[i][v[j]]='L';
        rep(j,N)if(fld[i][j]=='?')fld[i][j]='R';
    }

    rep(j,N){
        int cnt=0;
        rep(i,N)if(fld[i][j]=='U')cnt++;
        assert(cnt==U[j]);
        cnt=0;
        rep(i,N)if(fld[i][j]=='D')cnt++;
        assert(cnt==D[j]);
    }
    rep(i,N){
        assert(count(all(fld[i]),'L')==L[i]);
        assert(count(all(fld[i]),'R')==R[i]);
    }


    rep(i,N)rep(j,N){
        if(fld[i][j]=='U'){
            for(int k=0;k<i;k++)if(fld[k][j]=='L'||fld[k][j]=='R')G[k*N+j].pb(i*N+j);
        }
        else if(fld[i][j]=='D'){
            for(int k=i+1;k<N;k++)if(fld[k][j]=='L'||fld[k][j]=='R')G[k*N+j].pb(i*N+j);
        }
        else if(fld[i][j]=='L'){
            for(int k=0;k<j;k++)if(fld[i][k]=='U'||fld[i][k]=='D')G[i*N+k].pb(i*N+j);
        }
        else{
            for(int k=j+1;k<N;k++)if(fld[i][k]=='U'||fld[i][k]=='D')G[i*N+k].pb(i*N+j);
        }
    }

    rep(i,N*N)for(auto x:G[i])deg[x]++;
    queue<int>que;
    rep(i,N*N)if(deg[i]==0){
        que.push(i);
    }
    while(que.size()){
        int y,x;
        int ei=que.front();que.pop();
        y=ei/N;x=ei%N;

        if(fld[y][x]=='U'){
            cout<<'U'<<x+1<<endl;
        }
        else if(fld[y][x]=='D'){
            cout<<'D'<<x+1<<endl;
        }
        else if(fld[y][x]=='L'){
            cout<<'L'<<y+1<<endl;
        }
        else{
            cout<<'R'<<y+1<<endl;
        }
        for(auto v:G[ei])if(--deg[v]==0)que.push(v);
    }
    return 0;
}


Measured memory_bytes: 95360