#include int dmap[4][2] = { { -1, 0 }, { 1, 0 }, { 0, -1 }, { 0, 1 } }; char dchar[4] = { 'U', 'D', 'L', 'R' }; int main () { int h = 0; int w = 0; int k = 0; int l = 0; int r = 0; char s[500][501] = {}; int res = 0; int is_ok = 0; char t[500001] = ""; int d[500][500][2] = {}; int prev[500][500][2] = {}; int q[250000][2] = {}; int q_hd = 0; int q_tl = 0; res = scanf("%d", &h); res = scanf("%d", &w); res = scanf("%d", &k); res = scanf("%d", &l); res = scanf("%d", &r); for (int i = 0; i < h; i++) { res = scanf("%s", s[i]); } if ((r-l)%2 == 0) { printf("No\n"); return 0; } for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { d[i][j][0] = h*w; d[i][j][1] = h*w; } } d[0][0][0] = 0; q[q_tl][0] = 0; q[q_tl][1] = 0; prev[0][0][0] = -1; q_tl++; while (q_hd < q_tl) { int ci = q[q_hd][0]; int cj = q[q_hd][1]; int tmp_d = d[ci][cj][0]; q_hd++; for (int i = 0; i < 4; i++) { int ni = ci+dmap[i][0]; int nj = cj+dmap[i][1]; if (ni >= 0 && ni < h && nj >= 0 && nj < w && s[ni][nj] == '.' && d[ni][nj][0] >= h*w) { d[ni][nj][0] = tmp_d+1; prev[ni][nj][0] = i; q[q_tl][0] = ni; q[q_tl][1] = nj; q_tl++; } } } q_hd = 0; q_tl = 0; d[h-1][w-1][1] = 0; q[q_tl][0] = h-1; q[q_tl][1] = w-1; prev[h-1][w-1][1] = -1; q_tl++; while (q_hd < q_tl) { int ci = q[q_hd][0]; int cj = q[q_hd][1]; int tmp_d = d[ci][cj][1]; q_hd++; for (int i = 0; i < 4; i++) { int ni = ci+dmap[i][0]; int nj = cj+dmap[i][1]; if (ni >= 0 && ni < h && nj >= 0 && nj < w && s[ni][nj] == '.' && d[ni][nj][1] >= h*w) { d[ni][nj][1] = tmp_d+1; prev[ni][nj][1] = i; q[q_tl][0] = ni; q[q_tl][1] = nj; q_tl++; } } } for (int i = 0; i < h; i++) { for (int j = 1; j < w-1; j++) { if (is_ok <= 0 && d[i][j][0] < l && d[i][j][0]%2 != l%2 && s[i][j-1] == '.' && s[i][j+1] == '.' && d[i][j][1] <= k-r && d[i][j][1]%2 == (k-r)%2) { int ti = i; int tj = j; is_ok = 1; for (int p = d[i][j][0]; p > 0; p--) { int ni = ti+dmap[((prev[ti][tj][0])^1)][0]; int nj = tj+dmap[((prev[ti][tj][0])^1)][1]; t[p-1] = dchar[prev[ti][tj][0]]; ti = ni; tj = nj; } for (int p = d[i][j][0]; p < k-d[i][j][1]; p++) { t[p] = dchar[2+p%2]; } ti = i; tj = j; for (int p = k-d[i][j][1]; p < k; p++) { int ni = ti+dmap[((prev[ti][tj][1])^1)][0]; int nj = tj+dmap[((prev[ti][tj][1])^1)][1]; t[p] = dchar[((prev[ti][tj][1])^1)]; ti = ni; tj = nj; } t[k] = '\0'; } } } for (int i = 1; i < h-1; i++) { for (int j = 0; j < w; j++) { if (is_ok <= 0 && d[i][j][0] < l && d[i][j][0]%2 != l%2 && s[i-1][j] == '.' && s[i+1][j] == '.' && d[i][j][1] <= k-r && d[i][j][1]%2 == (k-r)%2) { int ti = i; int tj = j; is_ok = 1; for (int p = d[i][j][0]; p > 0; p--) { int ni = ti+dmap[((prev[ti][tj][0])^1)][0]; int nj = tj+dmap[((prev[ti][tj][0])^1)][1]; t[p-1] = dchar[prev[ti][tj][0]]; ti = ni; tj = nj; } for (int p = d[i][j][0]; p < k-d[i][j][1]; p++) { t[p] = dchar[p%2]; } ti = i; tj = j; for (int p = k-d[i][j][1]; p < k; p++) { int ni = ti+dmap[((prev[ti][tj][1])^1)][0]; int nj = tj+dmap[((prev[ti][tj][1])^1)][1]; t[p] = dchar[((prev[ti][tj][1])^1)]; ti = ni; tj = nj; } t[k] = '\0'; } } } if (k == 500000) { return 1; } if (is_ok > 0) { printf("Yes\n%s\n", t); } else { printf("No\n"); } return 0; }