Evaluate a scrambled circuit

Cryptographic protocols, Autumn 2009, 4th home exercise

Consider this scrambled circuit. We have fixed the encryption scheme and other details as follows: Evaluate the circuit.

The key for the input node 1 is egbcitadswkrxmolphjqfvzyun
The key for the input node 2 is cbfutlygjiwvmhxasokedqnprz
The key for the input node 3 is ibocrzjaxgqwmpysfeuhlkvdtn
The key for the input node 4 is bvslxetucwghjmofayzrqipknd
The key for the input node 5 is iolfuxvdaezqnpjrhcwmygbkst
The key for the input node 6 is rsowvfgncydzeqxthkbjaumpil
The key for the input node 7 is xdgnmwtjqshyureiabkcovzlpf
The key for the input node 8 is ozcbivmslnjexwdukyfqrathgp
The encoding of the internal node 9 is gejblmmjbgajxifpxbhudfqnswvmziyjerkoctalg, ugkzmeekzuskvcaghqbypfaznjlsuexkrtcovdmiw, dxpvbccpvdgpimnaivzsonwrtejclmypxqhukfgbd, xcfrwbbfrxnfjezchlopvyzrtkanxbifqmeujgwsd
The encoding of the internal node 10 is xcfrwbbfrxnfjezrmqeltsdhzixabvgckjyupofnw, ugkzmeekzuskvcaypazolmcqukersjbvdfnghiwtx, gejblmmjbgajxifkzfbrqlipgjmoatnxshdeywucv, dxpvbccpvdgpimnhlnvqwbmadpcugfritzoxyeskj
The encoding of the internal node 11 is mudviffdvmzdkcnbxohrznidewfasmklcvjpytgqu, gmsqfuusqgbsthzpeoatdxqlkunhwjsvmrficgzby, vzewlxxewvkeqgymhfbjkyleanxdivqtgwucopsrz, zxnhollnhzynpuciaewpbmhkqlfugvntxjodszcyr
The encoding of the internal node 12 is nebfhyybfnwbkomriqpmvtcnzufodelgxhjbkywas, cjklgddklcbkpizuboavmydwfpqrtljcxhzeikngs, ogwtfbbwtoxwslkuimnkyzvopjtlhgrqcfawsbxde, ihqxpwwqxiuqjfbcoldbzmgikexfvhatnprqjwuys
The encoding of the internal node 13 is sxafnuuafsvazptinmekdasfyvwbjhpuztqlorgxc, girkavvrkgyrmuqaczfwgqmtvorubysixjdhkenpl, ogmjrbbmjoamsfqyripctmojnavhukfbsqdewxzgl, cszmaiizmcnzydtaehkbctygiwzdvnjsoxrlmqpfu
The encoding of the internal node 14 is cszmaiizmcnzydtokubejcflmaqigpnsxhwdyvtzr, ogmjrbbmjoamsfqetvdznokxjrwbcuagiplfsyqmh, girkavvrkgyrmuqxflwcsgphkaevtnyijzoumbqrd, sxafnuuafsvazptuslxfckobztypjviagndwhmqre
The encoding of the internal node 15 is sfnwgaanwshnqozyntlcoxpwzjgsvfrmuhdkbeqia, ptwgkyywgpewlrbgjswbqnuvizdmfetaykxprchol, jislubbsljosvyxfsegdyzwlxcujkiaprotnmhvqb, azcslnncsawcthesdycekpfvbigmrwzunlqahxjot
The encoding of the internal node 16 is ptwgkyywgpewlrbjxwqmngohesvtcrlfyzapubdki, jislubbsljosvyxprstdclhwoagimyvzbenjqxkuf, azcslnncsawcthedqckmpsojwyvzxhtrniuafeglb, sfnwgaanwshnqozqmipfnlbrdkhouczatsvwgeyxj
The encoding of the internal node 17 is rnavessavrzaxwqkurianfcmjsvlpybwzxgothdqe, nizplbbzpnkzsqcuckqsyimejtvzhxnlpgadbrwof, hrujiccujhouflnmnolfpryevqsuzwhijtxgckdab, icojevvojihoaxtfthxazcnurwgodpiejbkmvslqy
The encoding of the internal node 18 is mzkhnjjkhmakrgvrebvuqzjwglaomntfisxdcpykh, weudvffudwpuslisztimaefclhpjwvqbrkngoxyud, demgsbbmgdjmfirqkhevfpaxzwgtuildsjoymnrbc, uhrncpprnuoridjiefjzthpxdqokucgslvawbymrn
The encoding of the internal node 19 is mxirghhirmbintwtfupcbzgednsrlkaohvmiwjyxq, bpvgnxxvgbovwqeqlhayoznmjwfgukrcxdbvesipt, gwckxyyckgacurbrdhnlasxqvutkpmojyzgcbefwi, wldmpggdmwadxejxuvptegdmasfjznocikwryqbhl
The encoding of the internal node 20 is wfqpmnnqpwtqolkhcxipgrlntfmdeqkosvwzujbay, imsnkyysnilsudvrxpgnawdylmkqfsvuehiojzcbt, gewltiiwlgjwmqkutzlyqsjgbkfcoxnihdapwrevm, isrtywwrtiurfdmkqhbtjgdwusycormfvniaxzelp
The encoding of the internal node 21 is heyfrttyfhjyxpgsiptrkymhxqdubcfgwvnlaejoz, zuwbcyywbznwveltgkejyubcsafmnphwodivrzqxl, rftmwlltmrztpnaegnlwvtkrpsqjcxmaihydbfzuo, jorabnnrajprkstimsnbfrljkvgcyhatezxduopqw
The encoding of the internal node 22 is tnmyerrmytfmdkwvukhgjdsctxlpiemayfqzbwnor, hxjpsbbjphkjumnyqfznwxoukhvpsbimjatgdlcre, ewkgajjkgeukqlrvzncrmwsquexgajflkhbdotyip, lfwchnnwcliwgjxqpkvxsftgilmchnbjwreyzdaou
The encoding of the internal node 23 is lxtqejjtqlmtwkogbjiovrsnacytpfldzwkxmueqh, ejqugwwquemqzfiphwlioscbadtqnxeyvzfjmrguk, fxklywwklfvkicqqborjyumxhkswdnzalfiepvcgt, profnjjofpyoclwsdjqwibkhuvgoaxpemclryznft
The encoding of the internal node 24 is fjygkeeygflyqsnzafrhipqjctukxdblnemswyovg, aqwxuttwxadwoirckalpjhoqefnuzbmdrtsigwyvx, nlixakkixnhiqojrdtyclwvfohbjpaqsemxungkzi, uwmtcyymtufmlpgrnujboelwzkacxhsfgyvpimqdt
The encoding of the internal node 25 is pdgnaiignpygkmlgwqkxvtlciduonjrzybhpseafm, zhitjqqitzcixorfvnwsktuzerpjcgadxbqlyimoh, zjhpvyyhpzghikdsatcenprzxdwvgqfbilyuohmkj, rbytoffytrsyqeuclpmxitnrauzoshvjqwfdgykeb
The encoding of the output node 26 is nbyphnf, bhyifgs
The encoding of the output node 27 is kbrntkc, rtzpqcb