Not able to get the question

Hello
I am trying to solve this question from hackeraearth…https://www.hackerearth.com/practice/algorithms/graphs/depth-first-search/practice-problems/algorithm/gudi-trapped-in-the-room-july-easy/

I am not able to understand the question…How when “SERA” spelled string is changing …Like what they mean by rotating clockwise by H position… abd when “Xhaka” will spelled how 178 will change in 781 given A = 3.
Please explain it…Thanks