Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a, b = [int(i) for i in input().split()]
- length = int(input())
- text = input()
- d = {('A', 0), ('B', 1), ('C', 2), ('D', 3), ('E', 4), ('F', 5), ('G', 6), ('H', 7), ('I', 8), ('J', 9),
- ('K', 10), ('L', 11), ('M', 12), ('N', 13), ('O', 14), ('P', 15), ('Q', 16), ('R', 17), ('S', 18), ('T', 19),
- ('U', 20), ('V', 21), ('W', 22), ('X', 23), ('Y', 24), ('Z', 25), (" ",26), (".",27), (",",28)}
- t=[(a*[m[1] for m in d if i==m[0]][0]+b)%29 for i in text]
- print("".join([[_[0] for _ in d if _[1]==i][0] for i in t]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement