#include using namespace std; #define int long long signed main(){ int H,W,K,L,R; cin>>H>>W>>K>>L>>R; vector> S(H,vector(W)); for(int i=0;i>S[i][j]; vector> G(H*W); for(int i=0;i dist(H*W,1e18); vector seen(H*W,1e18); seen[H*W-1] = 0; dist[0] = 0; queue q; q.push(0); while(!q.empty()){ int pos = q.front(); q.pop(); for(int x:G[pos]){ if(dist[x] != 1e18) continue; dist[x] = dist[pos] + 1; q.push(x); } } q.push(H*W-1); while(!q.empty()){ int pos = q.front(); q.pop(); for(int x:G[pos]){ if(seen[x] != 1e18) continue; seen[x] = seen[pos] + 1; q.push(x); } } if(dist[H*W-1] == 1e18 || dist[H*W-1]%2 != K%2 || (R-L)%2 == 0){ cout<<"No"<= L || seen[i*W+j] > K-R || dist[i*W+j]%2 == L%2 || seen[i*W+j]%2 != (K-R)%2 || dist[i*W+j] == 1e18 || seen[i*W+j] == 1e18) continue; bool a = (i != 0 && i != H-1 && S[i-1][j] == '.' && S[i+1][j] == '.'); bool b = (j != 0 && j != W-1 && S[i][j-1] == '.' && S[i][j+1] == '.'); if(a){ cout<<"Yes"< distt(H*W,1e18); distt[i*W+j] = 0; q.push(i*W+j); while(!q.empty()){ int pos = q.front(); q.pop(); for(int x:G[pos]){ if(distt[x] != 1e18) continue; distt[x] = distt[pos] + 1; q.push(x); } } while(now != i*W+j){ for(int x:G[now]){ if(distt[x]+1 == distt[now]){ if(x == now-1) t += 'R'; if(x == now+1) t += 'L'; if(x == now-W) t += 'D'; if(x == now+W) t += 'U'; now = x; break; } } } reverse(s.begin(),s.end()); reverse(t.begin(),t.end()); for(int k=dist[i*W+j]+1;k distt(H*W,1e18); distt[i*W+j] = 0; q.push(i*W+j); while(!q.empty()){ int pos = q.front(); q.pop(); for(int x:G[pos]){ if(distt[x] != 1e18) continue; distt[x] = distt[pos] + 1; q.push(x); } } while(now != i*W+j){ for(int x:G[now]){ if(distt[x]+1 != distt[now]){ if(x == now-1) t += 'R'; if(x == now+1) t += 'L'; if(x == now-W) t += 'D'; if(x == now+W) t += 'U'; now = x; break; } } } reverse(s.begin(),s.end()); reverse(t.begin(),t.end()); for(int k=dist[i*W+j]+1;k