| f | import sys | f | import sys | 
            | n | encodings = ['KOI8-R', 'CP1251', 'MACCYRILLIC', 'CP866', 'ISO-8859-5', ' | n | encodings = ['koi8-r', 'cp1251', 'mac-cyrillic', 'cp866', 'iso8859-5', ' | 
            |  | CP855'] |  | cp855'] | 
            |  | line = sys.stdin.buffer.read() |  | text_bytes = sys.stdin.buffer.read() | 
            |  | to_break = False |  | done = False | 
            |  | for first_encoding in encodings: |  | for encoding1 in encodings: | 
            |  | if to_break: |  | if done: | 
            |  | break |  | break | 
            |  | try: |  | try: | 
            | n | decoded = line.decode(first_encoding) | n | decoded = text_bytes.decode(encoding1) | 
            |  | for second_encoding in encodings: |  | for encoding2 in encodings: | 
            |  | if to_break: |  | if done: | 
            |  | break |  | break | 
            |  | try: |  | try: | 
            | n | encoded = decoded.encode(second_encoding) | n | encoded = decoded.encode(encoding2) | 
            |  | for third_encoding in encodings: |  | for encoding3 in encodings: | 
            |  | try: |  | try: | 
            | t | decoded2 = encoded.decode(third_encoding) | t | result = encoded.decode(encoding3) | 
            |  | if 'Зимбабве' in decoded2: |  | if 'Зимбабве' in result: | 
            |  | print(decoded2) |  | print(result) | 
            |  | to_break = True |  | done = True | 
            |  | break |  | break | 
            |  | except: |  | except: | 
            |  | pass |  | pass | 
            |  | except: |  | except: | 
            |  | pass |  | pass | 
            |  | except: |  | except: | 
            |  | pass |  | pass |