#!/usr/bin/python

# This program is pretty single-purpose---it takes in a
# file that has two-byte chars in strings that has
# been encoded flat---that is, \x00\x10 would be 16--and
# outputs the same thing only with the two byte encoding
# where byte number one is +127.  So, \xa1\x10 would be 16.

# Hopefully, no one will ever need this again. 

import string, sys

while ( 1 ):
    char = sys.stdin.read( 1 )

    if ( char == "" ):
        break

    if ( char == "\\" ):
        char2 = sys.stdin.read( 1 )

        if ( char2 == "x" ):
            # read the next six bytes
            theThing = char + char2 + sys.stdin.read(6);

            if ( theThing[2:4] == "00"  ):
                newPart = "a1"
            else:
                newPart = "a2"

            theThing = "\\x" + newPart + theThing[4:]            
            
            sys.stdout.write( theThing );
            
        else:
            sys.stdout.write( char + char2 );
    else:

        sys.stdout.write( char );
