#include <bits/stdc++.h>

using namespace std;

const int N = 333;

vector <int> g[N * N];
bool alive_b[N * N];
int pb[N * N], was[N * N];
int it;

int start = -1;

bool dfs(int v) {
  was[v] = it;
  for (int j = 0; j < (int) g[v].size(); j++) {
    int u = g[v][j];
    if (alive_b[u] && (pb[u] == -1 || pb[u] == start)) {
      pb[u] = v;
      return true;
    }
  }
  for (int j = 0; j < (int) g[v].size(); j++) {
    int u = g[v][j];
    if (alive_b[u] && was[pb[u]] != it) {
      if (dfs(pb[u])) {
        pb[u] = v;
        return true;
      }
    }
  }
  return false;
}

bool dfs_finish(int v, int finish) {
  if (pb[finish] == v) {
    return true;
  }
  start = v;
  it++;
  if (dfs(pb[finish])) {
    pb[finish] = v;
    return true;
  }
  return false;
}

int what[N * N];
int U[N], D[N], L[N], R[N];
int empty[N][N];
int first_L[N], first_U[N];
int cell_L[N], cell_R[N], cell_U[N], cell_D[N];

int n;

void take_cell(int i, int j) {
  alive_b[i * n + j] = false;
  empty[i][j] = 0;
  if (cell_L[i] == j) {
    while (cell_L[i] < n && !empty[i][cell_L[i]]) {
      cell_L[i]++;
    }
  }
  if (cell_R[i] == j) {
    while (cell_R[i] >= 0 && !empty[i][cell_R[i]]) {
      cell_R[i]--;
    }
  }
  if (cell_U[j] == i) {
    while (cell_U[j] < n && !empty[cell_U[j]][j]) {
      cell_U[j]++;
    }
  }
  if (cell_D[j] == i) {
    while (cell_D[j] >= 0 && !empty[cell_D[j]][j]) {
      cell_D[j]--;
    }
  }
}

int deg[N * N];

int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", U + i);
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", D + i);
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", L + i);
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", R + i);
  }
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      g[cnt].push_back(i * n + j);
    }
    what[cnt] = i;
    deg[cnt] = L[i] + R[i];
    first_L[i] = cnt++;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      g[cnt].push_back(j * n + i);
    }
    what[cnt] = ~i;
    deg[cnt] = U[i] + D[i];
    first_U[i] = cnt++;
  }
  for (int i = 0; i < n * n; i++) {
    pb[i] = -1;
    was[i] = -1;
  }
  for (int i = 0; i < n * n; i++) {
    alive_b[i] = true;
  }
  for (int i = 0; i < cnt; i++) {
    for (int j = 0; j < deg[i]; j++) {
      it++;
      if (!dfs(i)) {
        puts("NO");
        return 0;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      empty[i][j] = 1;
    }
  }
  for (int i = 0; i < n; i++) {
    cell_L[i] = 0;
    cell_R[i] = n - 1;
    cell_U[i] = 0;
    cell_D[i] = n - 1;
  }
  int iter = 0;
  while (iter < n * n) {
    {
      for (int i = 0; i < n; i++) {
        while (L[i] > 0) {
          int j = cell_L[i];
          if (pb[i * n + j] == first_L[i]) {
            printf("L%d\n", i + 1);
            L[i]--;
            take_cell(i, j);
            ++iter;
          } else {
            break;
          }
        }
        while (R[i] > 0) {
          int j = cell_R[i];
          if (pb[i * n + j] == first_L[i]) {
            printf("R%d\n", i + 1);
            R[i]--;
            take_cell(i, j);
            ++iter;
          } else {
            break;
          }
        }
      }
      for (int j = 0; j < n; j++) {
        while (U[j] > 0) {
          int i = cell_U[j];
          if (pb[i * n + j] == first_U[j]) {
            printf("U%d\n", j + 1);
            U[j]--;
            take_cell(i, j);
            ++iter;
          } else {
            break;
          }
        }
        while (D[j] > 0) {
          int i = cell_D[j];
          if (pb[i * n + j] == first_U[j]) {
            printf("D%d\n", j + 1);
            D[j]--;
            take_cell(i, j);
            ++iter;
          } else {
            break;
          }
        }
      }
    }
    for (int i = 0; i < n; i++) {
      while (L[i] > 0) {
        int j = cell_L[i];
        if (dfs_finish(first_L[i], i * n + j)) {
          printf("L%d\n", i + 1);
          L[i]--;
          take_cell(i, j);
          ++iter;
          break;
        } else {
          break;
        }
      }
      while (R[i] > 0) {
        int j = cell_R[i];
        if (dfs_finish(first_L[i], i * n + j)) {
          printf("R%d\n", i + 1);
          R[i]--;
          take_cell(i, j);
          ++iter;
          break;
        } else {
          break;
        }
      }
    }
    for (int j = 0; j < n; j++) {
      while (U[j] > 0) {
        int i = cell_U[j];
        if (dfs_finish(first_U[j], i * n + j)) {
          printf("U%d\n", j + 1);
          U[j]--;
          take_cell(i, j);
          ++iter;
          break;
        } else {
          break;
        }
      }
      while (D[j] > 0) {
        int i = cell_D[j];
        if (dfs_finish(first_U[j], i * n + j)) {
          printf("D%d\n", j + 1);
          D[j]--;
          take_cell(i, j);
          ++iter;
          break;
        } else {
          break;
        }
      }
    }
  }
  return 0;
}


Measured memory_bytes: 5760