#!/usr/bin/python

import binascii
import struct
import sys
from Crypto.Cipher import AES
from BeautifulSoup import BeautifulSoup, BeautifulStoneSoup

def decrypt_SMIL(encsmil):
    encdata = binascii.unhexlify(encsmil)

    xmldeckeys = [
        ['B7F67F4B985240FAB70FF1911FCBB48170F2C86645C0491F9B45DACFC188113F',
         'uBFEvpZ00HobdcEo'],
        ['3484509D6B0B4816A6CFACB117A7F3C842268DF89FCC414F821B291B84B0CA71',
         'SUxSFjNUavzKIWSh'],
        ['1F0FF021B7A04B96B4AB84CCFD7480DFA7A972C120554A25970F49B6BADD2F4F',
         'tqo8cxuvpqc7irjw'],
        ['76A9FDA209D4C9DCDFDDD909623D1937F665D0270F4D3F5CA81AD2731996792F',
         'd9af949851afde8c'],
        ['852AEA267B737642F4AE37F5ADDF7BD93921B65FE0209E47217987468602F337',
         'qZRiIfTjIGi3MuJA'],
        ['8CE8829F908C2DFAB8B3407A551CB58EBC19B07F535651A37EBC30DEC33F76A2',
        'O3r9EAcyEeWlm5yV'],
        ['246DB3463FC56FDBAD60148057CB9055A647C13C02C64A5ED4A68F81AE991BF5',
         'vyf8PvpfXZPjc7B1'],
        ['4878B22E76379B55C962B18DDBC188D82299F8F52E3E698D0FAF29A40ED64B21',
         'WA7hap7AGUkevuth']
    ]

    for key in xmldeckeys[:]:
        smil=""
        out=[0, 0, 0, 0]
        ecb = AES.new(binascii.unhexlify(key[0]), AES.MODE_ECB)
        unaes = ecb.decrypt(encdata)

        packer = struct.Struct("iiii")
        xorkey = packer.unpack(key[1])

        for i in range(0, len(encdata)/16):
            x=unaes[i*16:i*16+16]
            res = packer.unpack(x)
            for j in range(0,4):
                out[j] = res[j] ^ xorkey[j]
            x=encdata[i*16:i*16+16]
            xorkey = packer.unpack(x)
            x=packer.pack(out[0],out[1],out[2],out[3])
            smil = smil + x

        if (smil.find("<smil") == 0):
            i = smil.rfind("</smil>")
            smil = smil[0:i+7]
            return smil

if __name__=="__main__":
    buf=raw_input(sys.stdin)
    buf=decrypt_SMIL(buf)
    smilSoup=BeautifulStoneSoup(buf)
    print smilSoup.prettify
