18 lines
492 B
Python
18 lines
492 B
Python
import re
|
|
|
|
def substitute_digits(match):
|
|
digit_mapping = {'0': 'a', '1': 'b', '2': 'c', '3': 'd', '4': 'e', '5': 'f', '6': 'g', '7': 'h', '8': 'i', '9': 'j'}
|
|
return ''.join([digit_mapping[d] for d in match.group()])
|
|
|
|
if __name__ == "__main__":
|
|
while True:
|
|
try:
|
|
line = input()
|
|
if not line:
|
|
break
|
|
|
|
result = re.sub(r'\b\d{4}\b', substitute_digits, line)
|
|
print(result)
|
|
|
|
except EOFError:
|
|
break |