import sys # Define the mapping based on the provided examples. # This dictionary stores the number-to-character correspondence. # Based on the examples: # 3 -> k # 8 -> e # 7 -> d # 4 -> i mapping = { 3: 'k', 8: 'e', 7: 'd', 4: 'i' # If the problem intended a longer, standard string (like 'aikokushin', # 'keyence', 'atcoder', etc.) and the examples were selective or # slightly off, this map would need to be adjusted. # However, based *strictly* on the given examples, this is the direct mapping. # For example, if the string was 'aikokushin' (1-based index): # mapping = {i: c for i, c in enumerate('aikokushin', 1)} # But this doesn't match all examples (e.g., 8->h, not e). # Therefore, we use the explicit mapping from the examples. } # Read input line by line until 0 is encountered while True: try: # Read a line from standard input line = sys.stdin.readline() # If input stream ends unexpectedly before 0, stop. if not line: break # Convert the read line (string) to an integer # .strip() removes leading/trailing whitespace (like the newline character) num = int(line.strip()) # Check for the termination condition (input is 0) if num == 0: break # If the number is not 0, find its corresponding character # using the 'mapping' dictionary and print it. # It's assumed that any non-zero input number will be a key # present in the 'mapping' dictionary based on the problem statement # implicitly defining the required mappings through examples. # If a number not in the examples appeared, this would cause a KeyError. print(mapping[num]) except EOFError: # End of file reached break except ValueError: # Input was not a valid integer, which contradicts the problem statement. # Stop processing in this unexpected case. # print("Invalid input encountered.", file=sys.stderr) # Optional error message break # No need to explicitly handle KeyError if we trust the problem statement # implies only numbers from examples (or 0) will be input.