#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
bool isok(vector<int>a, vector<int>b, vector<int>c, int alp)
{
	for (int i = 0; i < a.size(); i++)if (a[i] < 0)return false;
	for (int i = 0; i < b.size(); i++)if (b[i] < 0)return false;
	for (int i = 0; i < c.size(); i++)if (c[i] < 0)return false;
	int gen = alp;
	for (int i = 0; i < a.size(); i++)gen += a[i];
	sort(a.begin(), a.end());
	sort(b.begin(), b.end());
	sort(c.begin(), c.end());
	int sum = 0;
	for (int i = 0; i < b.size(); i++)sum += b[i];
	for (int i = 0; i < c.size(); i++)sum += c[i];
	int pb = int(b.size()) - 1, pc = int(c.size()) - 1;
	for (int i = 0; i <= a.size(); i++)
	{
		int t = a.size() - i;
		for (;;)
		{
			if (pb != -1 && b[pb] > t + 1)sum -= b[pb], pb--;
			else break;
		}
		for (;;)
		{
			if (pc != -1 && c[pc] > t)sum -= c[pc], pc--;
			else break;
		}
		if (sum + (t + 1)*(b.size() - pb - 1) + t*(c.size() - pc - 1) < gen)return false;
		if (i != a.size())sum += a[i];
	}
	sum = alp, pb = int(b.size()) - 1, pc = int(c.size()) - 1;
	for (int i = 0; i < b.size(); i++)sum += b[i];
	for (int i = 0; i < c.size(); i++)sum += c[i];
	for (int i = 0; i <= a.size(); i++)
	{
		int t = a.size() - i;
		for (;;)
		{
			if (pb != -1 && b[pb] > t)sum -= b[pb], pb--;
			else break;
		}
		for (;;)
		{
			if (pc != -1 && c[pc] > t)sum -= c[pc], pc--;
			else break;
		}
		if (sum + t*(b.size() - pb - 1) + t*(c.size() - pc - 1) < gen)return false;
		if (i != a.size())sum += a[i];
	}
	return true;
}
int ans[333][333];
int u[333], d[333], l[333], r[333];
int ver[333];
bool flag[333][333];
typedef pair<int, int>pii;
vector<pii>topo;
void dfs(int x, int y, int num)
{
	if (flag[x][y])return;
	flag[x][y] = true;
	if (ans[x][y] == 1)for (int i = 0; i <= y - 1; i++)dfs(x, i, num);
	else if (ans[x][y] == 2)for (int i = y + 1; i < num; i++)dfs(x, i, num);
	else if (ans[x][y] == 3)for (int i = 0; i <= x - 1; i++)dfs(i, y, num);
	else if (ans[x][y] == 4)for (int i = x + 1; i < num; i++)dfs(i, y, num);
	topo.push_back(make_pair(x, y));
}
int main()
{
	int num;
	scanf("%d", &num);
	for (int i = 0; i < num; i++)scanf("%d", &u[i]);
	for (int i = 0; i < num; i++)scanf("%d", &d[i]);
	for (int i = 0; i < num; i++)scanf("%d", &l[i]);
	for (int i = 0; i < num; i++)scanf("%d", &r[i]);
	for (int i = 0; i < num; i++)ver[i] = num - u[i] - d[i];
	vector<int>za, zb, zc;
	for (int i = 0; i < num; i++)za.push_back(l[i] + r[i]), zc.push_back(num - u[i] - d[i]);
	if (!isok(za, zb, zc, 0))
	{
		printf("NO\n");
		return 0;
	}
	for (int i = 0; i < num; i++)
	{
		int p1 = 0;
		for (;;)
		{
			if (l[i] == 0)break;
			for (;;)
			{
				l[i]--, ver[p1]--;
				vector<int>a, b, c;
				for (int j = i + 1; j < num; j++)a.push_back(l[j] + r[j]);
				for (int j = 0; j < num; j++)
				{
					if (p1 < j)b.push_back(ver[j]);
					else c.push_back(ver[j]);
				}
				if (isok(a, b, c, l[i] + r[i]))
				{
					ans[i][p1] = 1;
					p1++;
					break;
				}
				else l[i]++, ver[p1]++, p1++;
			}
		}
		int p2 = num - 1;
		for (;;)
		{
			if (r[i] == 0)break;
			for (;;)
			{
				r[i]--, ver[p2]--;
				vector<int>a, b, c;
				for (int j = i + 1; j < num; j++)a.push_back(l[j] + r[j]);
				for (int j = 0; j < num; j++)
				{
					if (p1 <= j&&j < p2)b.push_back(ver[j]);
					else c.push_back(ver[j]);
				}
				if (isok(a, b, c, l[i] + r[i]))
				{
					ans[i][p2] = 2;
					p2--;
					break;
				}
				else r[i]++, ver[p2]++, p2--;
			}
		}
	}
	for (int i = 0; i < num; i++)
	{
		for (int j = 0; j < num; j++)
		{
			if (ans[j][i] == 0)
			{
				if (u[i] != 0)u[i]--, ans[j][i] = 3;
				else d[i]--, ans[j][i] = 4;
			}
		}
	}
	for (int i = 0; i < num; i++)
	{
		for (int j = 0; j < num; j++)
		{
			if (!flag[i][j])dfs(i, j, num);
		}
	}
	for (int i = 0; i < topo.size(); i++)
	{
		int x = topo[i].first, y = topo[i].second;
		if (ans[x][y] == 1)printf("L%d\n", x + 1);
		else if (ans[x][y] == 2)printf("R%d\n", x + 1);
		else if (ans[x][y] == 3)printf("U%d\n", y + 1);
		else if (ans[x][y] == 4)printf("D%d\n", y + 1);
	}
}

Measured memory_bytes: 2044