#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <string>
#include <string.h>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <map>
#include <set>
#include <iostream>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define gep(i,g,j) for(int i = g.head[j]; i != -1; i = g.e[i].next)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcount
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define df(x) int x = in()
#define dame { puts("NO"); return 0;}
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,vector<T>,greater<T> >
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(vector<T>&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,vector<T>&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;
const int di[] = {-1,0,1,0}, dj[] = {0,-1,0,1}; //^<v>
const string ds = "ULDR";

// Max flow
struct maxflow {
  typedef int TT;
  int n;
  vi to, next, head, dist, it;
  vector<TT> lim;
  maxflow(){}
  maxflow(int n):n(n),head(n,-1),it(n){}
  void add(int a, int b, TT c=1) {
    next.pb(head[a]); head[a] = to.size(); to.pb(b); lim.pb(c);
    next.pb(head[b]); head[b] = to.size(); to.pb(a); lim.pb(0); 
  }
  // void add2(int a, int b, int c=1) {
  //   next.pb(head[a]); head[a] = to.size(); to.pb(b); lim.pb(c);
  //   next.pb(head[b]); head[b] = to.size(); to.pb(a); lim.pb(c); 
  // }
  void bfs(int sv) {
    dist = vi(n,INF); // INF !!
    queue<int> q;
    dist[sv] = 0; q.push(sv);
    while (!q.empty()){
      int v = q.front(); q.pop();
      for (int i = head[v]; i != -1; i = next[i]) {
        if (lim[i] && dist[to[i]] == INF) { // double INF !!
          dist[to[i]] = dist[v]+1; q.push(to[i]);
        }
      }
    }
  }
  TT dfs(int v, int tv, TT nf=INF) { // INF !!
    if (v == tv) return nf;
    for (; it[v] != -1; it[v] = next[it[v]]) {
      int u = to[it[v]]; TT f;
      if (!lim[it[v]] || dist[v] >= dist[u]) continue;
      if (f = dfs(u, tv, min(nf, lim[it[v]])), f) { // double !!
        lim[it[v]] -= f;
        lim[it[v]^1] += f;
        return f;
      }
    }
    return 0;
  }
  int solve(int sv, int tv) {
    TT flow = 0, f;
    while (1) {
      bfs(sv);
      if (dist[tv] == INF) return flow; // INF !!
      rep(i,n) it[i] = head[i];
      while (f = dfs(sv,tv), f) flow += f;
    }
  }
};
//

int n;
vvi a;

int dfs(int i, int j) {
  if (a[i][j] < 0) return a[i][j];
  int ni = i, nj = j, v = a[i][j];
  // rep(i,n){rep(j,n) printf("%2d ", a[i][j]); puts("");} puts("");
  // cout<<i<<" "<<j<<" "<<a[i][j]<<endl;
  a[i][j] = -2;
  while (1) {
    ni += di[v]; nj += dj[v];
    if (ni < 0 || nj < 0 || ni >= n || nj >= n) break;
    int res = dfs(ni,nj);
    if (res == -2) {
      a[ni][nj] = v;
      if (a[i][j] == -2) return -2;
      return dfs(i,j);
    }
  }
  printf("%c", ds[v]);
  if (v&1) printf("%d\n", i+1);
  else printf("%d\n", j+1);
  return a[i][j] = -1;
}

int main() {
  n = in();
  vi u(n); rep(i,n) u[i] = in();
  vi d(n); rep(i,n) d[i] = in();
  vi l(n); rep(i,n) l[i] = in();
  vi r(n); rep(i,n) r[i] = in();
  rep(i,n) if (u[i]+d[i] > n) { puts("NO"); return 0;}
  rep(i,n) if (l[i]+r[i] > n) { puts("NO"); return 0;}
  // int sv = n*2, tv = sv+1, f = 0;
  // maxflow mf(tv+1);
  // rep(i,n)rep(j,n) mf.add(i,n+j,1);
  // rep(i,n) mf.add(sv,i,u[i]+d[i]), f += u[i]+d[i];
  // rep(i,n) mf.add(n+i,tv,n-l[i]-r[i]);
  // if (mf.solve(sv,tv) != f) { puts("NO"); return 0;}
  a = vvi(n,vi(n));
  // int id = 0;
  // rep(i,n)rep(j,n) {
  //   a[j][i] = mf.lim[id];
  //   id += 2;
  // }
  // rep(i,n){rep(j,n) printf("%d ", a[i][j]); puts("");}
  vi x(n), y(n);
  rep(i,n) x[i] = u[i]+d[i];
  rep(i,n) y[i] = l[i]+r[i];
  rep(i,n) {
    vp p;
    rep(j,n) p.pb(P(x[j],j));
    sort(rng(p));
    rep(k,y[i]) {
      int j = p[k].se;
      x[j]++;
      a[i][j] = 1;
    }
  }
  rep(i,n) if (x[i] != n) dame;
  rep(i,n) {
    int k = n-1;
    rep(j,d[i]) {
      while (a[k][i] != 0) --k;
      a[k][i] |= 2;
    }
  }
  rep(i,n) {
    int k = n-1;
    rep(j,r[i]) {
      while (a[i][k] != 1) --k;
      a[i][k] |= 2;
    }
  }
  // rep(i,n){rep(j,n) printf("%d ", a[i][j]); puts("");}
  rep(i,n)rep(j,n) dfs(i,j);
  return 0;
}







Measured memory_bytes: 1408