while True: try: pw = input() res = '' for ch in pw: if ord('a') <= ord(ch) <= ord('c'): ch = '2' elif ord('d') <= ord(ch) <= ord('f'): ch = '3' elif ord('g') <= ord(ch) <= ord('i'): ...