#include //#include using namespace std; //using namespace atcoder; //using mint = modint1000000007; //const int mod = 1000000007; //using mint = modint998244353; //const int mod = 998244353; const int INF = 1e9; //const long long LINF = 1e18; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep2(i,l,r)for(int i=(l);i<(r);++i) #define rrep(i, n) for (int i = (n-1); i >= 0; --i) #define rrep2(i,l,r)for(int i=(r-1);i>=(l);--i) #define all(x) (x).begin(),(x).end() #define allR(x) (x).rbegin(),(x).rend() #define endl "\n" #define P pair template inline bool chmax(A & a, const B & b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(A & a, const B & b) { if (a > b) { a = b; return true; } return false; } const int dx[] = { 1,0,-1,0 }; const int dy[] = { 0,-1,0,1 }; char cr[] = { 'U','R','D','L' }; char cr2[] = { 'D','L','U','R' }; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int h, w, k, l, r; cin >> h >> w >> k >> l >> r; vectors(h); rep(i, h)cin >> s[i]; if (0 == (r - l) % 2) { cout << "No" << endl; return 0; } vector> dp(h, vector(w, INF)); vector> dpR(h, vector(w, INF)); rep(_, 2) { queue> q; if (0 == _) { q.emplace(0, 0); dp[0][0] = 0; } else { q.emplace(h - 1, w - 1); dp[h - 1][w - 1] = 0; } while (!q.empty()) { int x = q.front().first; int y = q.front().second; q.pop(); rep(i, 4) { int nx = x + dx[i]; int ny = y + dy[i]; if ((0 <= nx) && (h > nx) && (0 <= ny) && (w > ny) && ('#' != s[nx][ny])) { if (chmin(dp[nx][ny], dp[x][y] + 1)) q.emplace(nx, ny); } } } swap(dp, dpR); } if (0 != abs(dp[h - 1][w - 1] - k) % 2) { cout << "No" << endl; return 0; } auto f = [&](int x, int y)->string { string ret; while (0 != dp[x][y]) { rep(i, 4) { int nx = x + dx[i]; int ny = y + dy[i]; if (nx < 0)continue; if (ny < 0)continue; if (nx >= h)continue; if (ny >= w)continue; char c = cr[i]; if (dp[nx][ny] + 1 == dp[x][y]) { x = nx; y = ny; ret += c; break; } } } return ret; }; rep(i, h)rep(j, w) { if (INF == dp[i][j])continue; int he = dp[i][j]; int ta = dpR[i][j]; int bo = k - he - ta; if (he >= l)continue; if (bo < 0)continue; if (he + bo > r)continue; if ((0 != j) && ('.' == s[i][j - 1]) && (w != j + 1) && ('.' == s[i][j + 1])) { string ans0 = f(i, j); swap(dp, dpR); swap(cr, cr2); string ans1; rep(i, bo / 2)ans1 += "LR"; string ans2 = f(i, j); cout << "Yes" << endl; cout << ans0 << ans1 << ans2 << endl; return 0; } if ((0 != i) && ('.' == s[i - 1][j]) && (h != (i + 1)) && ('.' == s[i + 1][j])) { string ans0 = f(i, j); swap(dp, dpR); swap(cr, cr2); string ans1; rep(i, bo / 2)ans1 += "DU"; string ans2 = f(i, j); cout << "Yes" << endl; cout << ans0 << ans1 << ans2 << endl; return 0; } } cout << "No" << endl; return 0; }