# [K (ngn/k)], 41 bytes

 {,/(&'b|-b:+(0|a),0&a:-':'(0,y)\x-97),'4}

[Try it online!][TIO-k2683yhn]

[K (ngn/k)]: https://gitlab.com/n9n/k
[TIO-k2683yhn]: https://tio.run/##y9bNS8/7/z/NqlpHX0NNPalGN8lKW8OgJlFTx0At0UpX3Updw0CnUjOmQtfSXFNH3aT2f1q0Ukp@upK1SSwXjGkMZmak5uTkK1mbgTnJ@Smp6fk5aUrWhgZggcTk1PTM7Nz8wuLS8kola6PY/wA "K (ngn/k) – Try It Online"

output: `0=D 1=R 2=U 3=L 4=!`