Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if __name__=='__main__':
- # mat=['abcde','fghij','klmno','pqrst','uvwxy','z;;;;']
- s=input()
- x=0
- y=0
- for i in s:
- x1=(ord(i)-97)//5
- y1=(ord(i)-97)%5
- if(i=='z'):
- while(x<4):
- x+=1
- print('D',end='')
- while(y>0):
- y-=1
- print('L',end='')
- if(x==4):
- x+=1
- print('D',end='')
- else:
- while(x>x1):
- x-=1
- print('U',end='')
- while(x<x1):
- x+=1
- print('D',end='')
- while(y>y1):
- y-=1
- print('L',end='')
- while(y<y1):
- y+=1
- print('R',end='')
- print('S',end='')
Advertisement
Add Comment
Please, Sign In to add comment