As the previous commenter noted, you need to give us some examples of what you've tried so far, or, at least walk us through your thought process and how you think you'd approach that kind of problem. I'm more than happy to offer suggestions or take a look at some working code, but since you did note it was for an exam you'll learn best by doing. Give it a whirl and throw up some code along with some comments.
---
echo S 1 [ Y V U | perl -ane 'print reverse map { $_ = chr(ord($_)-1) } @F;'