n | import sys | n | import sys as x |
| word = 'Зимбабве' | | y = 'Зимбабве' |
| codes = ['KOI8-R', 'CP1251', 'MACCYRILLIC', 'CP866', 'ISO-8859-5', 'CP85 | | a = ['KOI8-R', 'CP1251', 'MACCYRILLIC', 'CP866', 'ISO-8859-5', 'CP855'] |
| 5'] | | |
| s = sys.stdin.buffer.read() | | b = x.stdin.buffer.read() |
| for i in codes: | | for p in a: |
| try: | | try: |
n | dec_t = s.decode(i) | n | q = b.decode(p) |
| for e in codes: | | for f in a: |
| for d in codes: | | for g in a: |
| try: | | try: |
t | txt = dec_t.encode(d).decode(e) | t | h = q.encode(g).decode(f) |
| if word in txt: | | if y in h: |
| print(txt) | | print(h) |
| sys.exit(0) | | x.exit(0) |
| except (UnicodeDecodeError, UnicodeEncodeError): | | except (UnicodeDecodeError, UnicodeEncodeError): |
| pass | | pass |
| except UnicodeDecodeError: | | except UnicodeDecodeError: |
| pass | | pass |