djfz-2020-s444379/TaskD00/run
2020-12-02 19:46:38 +01:00

25 lines
571 B
Python

#!/usr/bin/python3
# re.sub(r' ', 'with what', 'string to replace in')
# 0123456789 - abcdefghij
import sys
import re
def changer(p):
p = re.sub(r'0', 'a' , p.group(0))
p = re.sub(r'1', 'b' , p)
p = re.sub(r'2', 'c' , p)
p = re.sub(r'3', 'd' , p)
p = re.sub(r'4', 'e' , p)
p = re.sub(r'5', 'f' , p)
p = re.sub(r'6', 'g' , p)
p = re.sub(r'7', 'h' , p)
p = re.sub(r'8', 'i' , p)
p = re.sub(r'9', 'j' , p)
return str(p)
for line in sys.stdin.readlines():
temp = re.sub(r'\d{4}', changer, line)
print(temp.strip('\n'))