From: Neil Smith Date: Wed, 6 Jan 2016 18:45:44 +0000 (+0000) Subject: Done challenge 7, updated Amsco implementation to match X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=bad2e528f12f37d7e07bf788e84a07e1cad09735;p=cipher-training.git Done challenge 7, updated Amsco implementation to match --- diff --git a/2015-challenge7.ipynb b/2015-challenge7.ipynb new file mode 100644 index 0000000..23259d8 --- /dev/null +++ b/2015-challenge7.ipynb @@ -0,0 +1,1575 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "%matplotlib inline\n", + "\n", + "from cipherbreak import *\n", + "\n", + "c7a = sanitise(open('2015/7a.ciphertext').read())\n", + "c7b = sanitise(open('2015/7b.ciphertext').read())" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "(('annmarie', ), -1865.8708508162845)" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "(key_a_word, key_a_wrap), score = keyword_break_mp(c7a)\n", + "(key_a_word, key_a_wrap), score" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "dhorlieithinkiknacchotisgainganfutineewtadhedkobecthingsfebareirepartcemoyhoveonappartunityhereidhedkewthedipherdlerksfodkgraunwonwitturnsautsheischiterussionherbomilylebtmasdacinfutshehosrelotivesinthegulogotpermshedleorlyhosnalavebarthesavietgavernmentsaiomstillnatsurechashecoscarkingbarfutithinkthisiskeyintelligendeinthemeontimeihovefeencotdhingthefritstheyseemtahovefeenindantodtcithaurbrienwsinthereidhswaktaronwtheyinturnhovefeencotdhingthebrendhitseemslikeceoreollcarkingogoinstaneonatherchidhireollywiwntexpedtonwgivenchotcereowinthebrendhwadumentlostceekiwantthinkthotisodaindiwendemyacnguessisthottherussionsknacchotisgainganonwthotaurfesthapeabundaveringitistafreokintatheirhqonwtrytabinwsamethingthereunbartunotelyoddarwingtamysaurdeyuritheyhovetokentausingonecdiphersalitoirebarordhivestarogeabtapsedretbilessaevenibcemonogetasteoltherelevontbileitcilltokeolatabdamputingtafreokthedipheriottodhofriebmessogebramyuriendryptewusingonomsdadipherkeycarwlengthissixinchidhhewesdrifesthedipheritisverydleversimpletaimplementfutoweviltadrodkonwmyanehapeisthotcedonolsabinwthedipherkeychileinthehqarotleostportabitiplontaenterintcaceeksanwedemfersixteenththerussionsorehastingolorgeprapogonwoeventosportabtheinternotianolefouousstellungcithleowingpalitfuramemfersinottenwondemastabthesedurityteomcillfeaddupiewciththotonwhqseduritycillferelotivelylightcithludkicillgetinonwautciththebilesceneewthotnightonwthencedongettathefattamabthechalereidhswaktarstrotogemollthefesthorry\n" + ] + } + ], + "source": [ + "print(keyword_decipher(c7a, key_a_word, wrap_alphabet=key_a_wrap))" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "{'A': 'a',\n", + " 'B': 'o',\n", + " 'C': 'p',\n", + " 'D': 'q',\n", + " 'E': 'f',\n", + " 'F': 'r',\n", + " 'G': 's',\n", + " 'H': 't',\n", + " 'I': 'e',\n", + " 'J': 'u',\n", + " 'K': 'v',\n", + " 'L': 'w',\n", + " 'M': 'c',\n", + " 'N': 'b',\n", + " 'O': 'x',\n", + " 'P': 'y',\n", + " 'Q': 'z',\n", + " 'R': 'd',\n", + " 'S': 'g',\n", + " 'T': 'h',\n", + " 'U': 'i',\n", + " 'V': 'j',\n", + " 'W': 'k',\n", + " 'X': 'l',\n", + " 'Y': 'm',\n", + " 'Z': 'n'}" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "trans_a = {p.upper(): c for p, c in zip(keyword_cipher_alphabet_of(key_a_word, wrap_alphabet=key_a_wrap), string.ascii_lowercase, )}\n", + "trans_a" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "'charlie i think i know what is going on but i need to check a few things before i report we may have an opportunity here i checked the cipher clerks background and it turns out she is white russian her family left moscow in but she has relatives in the gulag at perm she clearly has no love for the soviet government so i am still not sure who she was working for but i think this is key intelligence in the meantime i have been watching the brits they seem to have been in contact with our friends in the reichs doktor and they in turn have been watching the french it seems like we are all working against one another which i really didnt expect and given what we read in the french document last week i dont think that is a coincidence my own guess is that the russians know what is going on and that our best hope of uncovering it is to break into their hq and try to find something there unfortunately according to my source yuri they have taken to using a new cipher solitaire for archive storage of top secret files so even if we manage to steal the relevant file it will take alot of computing to break the cipher i attach a brief message from yuri encrypted using an amsco cipher keyword length is six in which he describes the cipher it is very clever simple to implement but a devil to crack and my one hope is that we can also find the cipher key while in the hq or atleast part of it i plan to enter in two weeks on december sixteenth the russians are hosting a large propaganda event as part of the international ebau ausstellung with leading politburo members in attendance most of the security team will be occupied with that and hq security will be relatively light with luck i will get in and out with the files we need that night and then we can get to the bottom of the whole reichs doktor stratagem all the best harry'" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "translations = {\n", + " 'A': 'o',\n", + " 'B': 'a',\n", + " 'C': 'p',\n", + " 'D': 'q',\n", + " 'E': 'b',\n", + " 'F': 'r',\n", + " 'G': 's',\n", + " 'H': 't',\n", + " 'I': 'e',\n", + " 'J': 'u',\n", + " 'K': 'v',\n", + " 'L': 'd',\n", + " 'M': 'w',\n", + " 'N': 'f',\n", + " 'O': 'x',\n", + " 'P': 'y',\n", + " 'Q': 'z',\n", + " 'R': 'c',\n", + " 'S': 'g',\n", + " 'T': 'h',\n", + " 'U': 'i',\n", + " 'V': 'j',\n", + " 'W': 'k',\n", + " 'X': 'l',\n", + " 'Y': 'm',\n", + " 'Z': 'n'}\n", + "translation_table = ''.maketrans(translations)\n", + "plaintext = ' '.join(segment(c7a.upper().translate(translation_table)))\n", + "plaintext" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "'oapqbrsteuvdwfxyzcghijklmn'" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "''.join(translations[l] for l in sorted(translations))" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "'BERLINSTUVWXYZACDFGHJKMOPQ'" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "inverted_translations = {translations[a]: a for a in translations}\n", + "''.join(inverted_translations[l] for l in sorted(inverted_translations))" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "'berlinstuvwxyzacdfghjkmopq'" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "keyword_cipher_alphabet_of('berlin', wrap_alphabet=KeywordWrapAlphabet.from_largest)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "charlie i think i know what is going on but i need to check a few things before i report we may have an opportunity here i checked the cipher clerks background and it turns out she is white russian her family left moscow in but she has relatives in the gulag at perm she clearly has no love for the soviet government so i am still not sure who she was working for but i think this is key intelligence in the meantime i have been watching the brits they seem to have been in contact with our friends in the reichs doktor and they in turn have been watching the french it seems like we are all working against one another which i really didnt expect and given what we read in the french document last week i dont think that is a coincidence my own guess is that the russians know what is going on and that our best hope of uncovering it is to break into their hq and try to find something there unfortunately according to my source yuri they have taken to using a new cipher solitaire for archive storage of top secret files so even if we manage to steal the relevant file it will take alot of computing to break the cipher i attach a brief message from yuri encrypted using an amsco cipher keyword length is six in which he describes the cipher it is very clever simple to implement but a devil to crack and my one hope is that we can also find the cipher key while in the hq or atleast part of it i plan to enter in two weeks on december sixteenth the russians are hosting a large propaganda event as part of the international ebau ausstellung with leading politburo members in attendance most of the security team will be occupied with that and hq security will be relatively light with luck i will get in and out with the files we need that night and then we can get to the bottom of the whole reichs doktor stratagem all the best harry\n" + ] + } + ], + "source": [ + "print(' '.join(segment(keyword_decipher(c7a, 'berlin', wrap_alphabet=KeywordWrapAlphabet.from_largest))))" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "{(0, 1, 2, 3, 4, 5): (0, 1, 2, 3, 4, 5),\n", + " (0, 1, 2, 3, 5, 4): (0, 1, 2, 3, 5, 4),\n", + " (0, 1, 2, 4, 3, 5): (0, 1, 2, 4, 3, 5),\n", + " (0, 1, 2, 4, 5, 3): (0, 1, 2, 4, 5, 3),\n", + " (0, 1, 2, 5, 3, 4): (0, 1, 2, 5, 3, 4),\n", + " (0, 1, 2, 5, 4, 3): (0, 1, 2, 5, 4, 3),\n", + " (0, 1, 3, 2, 4, 5): (0, 1, 3, 2, 4, 5),\n", + " (0, 1, 3, 2, 5, 4): (0, 1, 3, 2, 5, 4),\n", + " (0, 1, 3, 4, 2, 5): (0, 1, 3, 4, 2, 5),\n", + " (0, 1, 3, 4, 5, 2): (0, 1, 3, 4, 5, 2),\n", + " (0, 1, 3, 5, 2, 4): (0, 1, 3, 5, 2, 4),\n", + " (0, 1, 3, 5, 4, 2): (0, 1, 3, 5, 4, 2),\n", + " (0, 1, 4, 2, 3, 5): (0, 1, 4, 2, 3, 5),\n", + " (0, 1, 4, 2, 5, 3): (0, 1, 4, 2, 5, 3),\n", + " (0, 1, 4, 3, 2, 5): (0, 1, 4, 3, 2, 5),\n", + " (0, 1, 4, 3, 5, 2): (0, 1, 4, 3, 5, 2),\n", + " (0, 1, 4, 5, 2, 3): (0, 1, 4, 5, 2, 3),\n", + " (0, 1, 4, 5, 3, 2): (0, 1, 4, 5, 3, 2),\n", + " (0, 1, 5, 2, 3, 4): (0, 1, 5, 2, 3, 4),\n", + " (0, 1, 5, 2, 4, 3): (0, 1, 5, 2, 4, 3),\n", + " (0, 1, 5, 3, 2, 4): (0, 1, 5, 3, 2, 4),\n", + " (0, 1, 5, 3, 4, 2): (0, 1, 5, 3, 4, 2),\n", + " (0, 1, 5, 4, 2, 3): (0, 1, 5, 4, 2, 3),\n", + " (0, 1, 5, 4, 3, 2): (0, 1, 5, 4, 3, 2),\n", + " (0, 2, 1, 3, 4, 5): (0, 2, 1, 3, 4, 5),\n", + " (0, 2, 1, 3, 5, 4): (0, 2, 1, 3, 5, 4),\n", + " (0, 2, 1, 4, 3, 5): (0, 2, 1, 4, 3, 5),\n", + " (0, 2, 1, 4, 5, 3): (0, 2, 1, 4, 5, 3),\n", + " (0, 2, 1, 5, 3, 4): (0, 2, 1, 5, 3, 4),\n", + " (0, 2, 1, 5, 4, 3): (0, 2, 1, 5, 4, 3),\n", + " (0, 2, 3, 1, 4, 5): (0, 2, 3, 1, 4, 5),\n", + " (0, 2, 3, 1, 5, 4): (0, 2, 3, 1, 5, 4),\n", + " (0, 2, 3, 4, 1, 5): (0, 2, 3, 4, 1, 5),\n", + " (0, 2, 3, 4, 5, 1): (0, 2, 3, 4, 5, 1),\n", + " (0, 2, 3, 5, 1, 4): (0, 2, 3, 5, 1, 4),\n", + " (0, 2, 3, 5, 4, 1): (0, 2, 3, 5, 4, 1),\n", + " (0, 2, 4, 1, 3, 5): (0, 2, 4, 1, 3, 5),\n", + " (0, 2, 4, 1, 5, 3): (0, 2, 4, 1, 5, 3),\n", + " (0, 2, 4, 3, 1, 5): (0, 2, 4, 3, 1, 5),\n", + " (0, 2, 4, 3, 5, 1): (0, 2, 4, 3, 5, 1),\n", + " (0, 2, 4, 5, 1, 3): (0, 2, 4, 5, 1, 3),\n", + " (0, 2, 4, 5, 3, 1): (0, 2, 4, 5, 3, 1),\n", + " (0, 2, 5, 1, 3, 4): (0, 2, 5, 1, 3, 4),\n", + " (0, 2, 5, 1, 4, 3): (0, 2, 5, 1, 4, 3),\n", + " (0, 2, 5, 3, 1, 4): (0, 2, 5, 3, 1, 4),\n", + " (0, 2, 5, 3, 4, 1): (0, 2, 5, 3, 4, 1),\n", + " (0, 2, 5, 4, 1, 3): (0, 2, 5, 4, 1, 3),\n", + " (0, 2, 5, 4, 3, 1): (0, 2, 5, 4, 3, 1),\n", + " (0, 3, 1, 2, 4, 5): (0, 3, 1, 2, 4, 5),\n", + " (0, 3, 1, 2, 5, 4): (0, 3, 1, 2, 5, 4),\n", + " (0, 3, 1, 4, 2, 5): (0, 3, 1, 4, 2, 5),\n", + " (0, 3, 1, 4, 5, 2): (0, 3, 1, 4, 5, 2),\n", + " (0, 3, 1, 5, 2, 4): (0, 3, 1, 5, 2, 4),\n", + " (0, 3, 1, 5, 4, 2): (0, 3, 1, 5, 4, 2),\n", + " (0, 3, 2, 1, 4, 5): (0, 3, 2, 1, 4, 5),\n", + " (0, 3, 2, 1, 5, 4): (0, 3, 2, 1, 5, 4),\n", + " (0, 3, 2, 4, 1, 5): (0, 3, 2, 4, 1, 5),\n", + " (0, 3, 2, 4, 5, 1): (0, 3, 2, 4, 5, 1),\n", + " (0, 3, 2, 5, 1, 4): (0, 3, 2, 5, 1, 4),\n", + " (0, 3, 2, 5, 4, 1): (0, 3, 2, 5, 4, 1),\n", + " (0, 3, 4, 1, 2, 5): (0, 3, 4, 1, 2, 5),\n", + " (0, 3, 4, 1, 5, 2): (0, 3, 4, 1, 5, 2),\n", + " (0, 3, 4, 2, 1, 5): (0, 3, 4, 2, 1, 5),\n", + " (0, 3, 4, 2, 5, 1): (0, 3, 4, 2, 5, 1),\n", + " (0, 3, 4, 5, 1, 2): (0, 3, 4, 5, 1, 2),\n", + " (0, 3, 4, 5, 2, 1): (0, 3, 4, 5, 2, 1),\n", + " (0, 3, 5, 1, 2, 4): (0, 3, 5, 1, 2, 4),\n", + " (0, 3, 5, 1, 4, 2): (0, 3, 5, 1, 4, 2),\n", + " (0, 3, 5, 2, 1, 4): (0, 3, 5, 2, 1, 4),\n", + " (0, 3, 5, 2, 4, 1): (0, 3, 5, 2, 4, 1),\n", + " (0, 3, 5, 4, 1, 2): (0, 3, 5, 4, 1, 2),\n", + " (0, 3, 5, 4, 2, 1): (0, 3, 5, 4, 2, 1),\n", + " (0, 4, 1, 2, 3, 5): (0, 4, 1, 2, 3, 5),\n", + " (0, 4, 1, 2, 5, 3): (0, 4, 1, 2, 5, 3),\n", + " (0, 4, 1, 3, 2, 5): (0, 4, 1, 3, 2, 5),\n", + " (0, 4, 1, 3, 5, 2): (0, 4, 1, 3, 5, 2),\n", + " (0, 4, 1, 5, 2, 3): (0, 4, 1, 5, 2, 3),\n", + " (0, 4, 1, 5, 3, 2): (0, 4, 1, 5, 3, 2),\n", + " (0, 4, 2, 1, 3, 5): (0, 4, 2, 1, 3, 5),\n", + " (0, 4, 2, 1, 5, 3): (0, 4, 2, 1, 5, 3),\n", + " (0, 4, 2, 3, 1, 5): (0, 4, 2, 3, 1, 5),\n", + " (0, 4, 2, 3, 5, 1): (0, 4, 2, 3, 5, 1),\n", + " (0, 4, 2, 5, 1, 3): (0, 4, 2, 5, 1, 3),\n", + " (0, 4, 2, 5, 3, 1): (0, 4, 2, 5, 3, 1),\n", + " (0, 4, 3, 1, 2, 5): (0, 4, 3, 1, 2, 5),\n", + " (0, 4, 3, 1, 5, 2): (0, 4, 3, 1, 5, 2),\n", + " (0, 4, 3, 2, 1, 5): (0, 4, 3, 2, 1, 5),\n", + " (0, 4, 3, 2, 5, 1): (0, 4, 3, 2, 5, 1),\n", + " (0, 4, 3, 5, 1, 2): (0, 4, 3, 5, 1, 2),\n", + " (0, 4, 3, 5, 2, 1): (0, 4, 3, 5, 2, 1),\n", + " (0, 4, 5, 1, 2, 3): (0, 4, 5, 1, 2, 3),\n", + " (0, 4, 5, 1, 3, 2): (0, 4, 5, 1, 3, 2),\n", + " (0, 4, 5, 2, 1, 3): (0, 4, 5, 2, 1, 3),\n", + " (0, 4, 5, 2, 3, 1): (0, 4, 5, 2, 3, 1),\n", + " (0, 4, 5, 3, 1, 2): (0, 4, 5, 3, 1, 2),\n", + " (0, 4, 5, 3, 2, 1): (0, 4, 5, 3, 2, 1),\n", + " (0, 5, 1, 2, 3, 4): (0, 5, 1, 2, 3, 4),\n", + " (0, 5, 1, 2, 4, 3): (0, 5, 1, 2, 4, 3),\n", + " (0, 5, 1, 3, 2, 4): (0, 5, 1, 3, 2, 4),\n", + " (0, 5, 1, 3, 4, 2): (0, 5, 1, 3, 4, 2),\n", + " (0, 5, 1, 4, 2, 3): (0, 5, 1, 4, 2, 3),\n", + " (0, 5, 1, 4, 3, 2): (0, 5, 1, 4, 3, 2),\n", + " (0, 5, 2, 1, 3, 4): (0, 5, 2, 1, 3, 4),\n", + " (0, 5, 2, 1, 4, 3): (0, 5, 2, 1, 4, 3),\n", + " (0, 5, 2, 3, 1, 4): (0, 5, 2, 3, 1, 4),\n", + " (0, 5, 2, 3, 4, 1): (0, 5, 2, 3, 4, 1),\n", + " (0, 5, 2, 4, 1, 3): (0, 5, 2, 4, 1, 3),\n", + " (0, 5, 2, 4, 3, 1): (0, 5, 2, 4, 3, 1),\n", + " (0, 5, 3, 1, 2, 4): (0, 5, 3, 1, 2, 4),\n", + " (0, 5, 3, 1, 4, 2): (0, 5, 3, 1, 4, 2),\n", + " (0, 5, 3, 2, 1, 4): (0, 5, 3, 2, 1, 4),\n", + " (0, 5, 3, 2, 4, 1): (0, 5, 3, 2, 4, 1),\n", + " (0, 5, 3, 4, 1, 2): (0, 5, 3, 4, 1, 2),\n", + " (0, 5, 3, 4, 2, 1): (0, 5, 3, 4, 2, 1),\n", + " (0, 5, 4, 1, 2, 3): (0, 5, 4, 1, 2, 3),\n", + " (0, 5, 4, 1, 3, 2): (0, 5, 4, 1, 3, 2),\n", + " (0, 5, 4, 2, 1, 3): (0, 5, 4, 2, 1, 3),\n", + " (0, 5, 4, 2, 3, 1): (0, 5, 4, 2, 3, 1),\n", + " (0, 5, 4, 3, 1, 2): (0, 5, 4, 3, 1, 2),\n", + " (0, 5, 4, 3, 2, 1): (0, 5, 4, 3, 2, 1),\n", + " (1, 0, 2, 3, 4, 5): (1, 0, 2, 3, 4, 5),\n", + " (1, 0, 2, 3, 5, 4): (1, 0, 2, 3, 5, 4),\n", + " (1, 0, 2, 4, 3, 5): (1, 0, 2, 4, 3, 5),\n", + " (1, 0, 2, 4, 5, 3): (1, 0, 2, 4, 5, 3),\n", + " (1, 0, 2, 5, 3, 4): (1, 0, 2, 5, 3, 4),\n", + " (1, 0, 2, 5, 4, 3): (1, 0, 2, 5, 4, 3),\n", + " (1, 0, 3, 2, 4, 5): (1, 0, 3, 2, 4, 5),\n", + " (1, 0, 3, 2, 5, 4): (1, 0, 3, 2, 5, 4),\n", + " (1, 0, 3, 4, 2, 5): (1, 0, 3, 4, 2, 5),\n", + " (1, 0, 3, 4, 5, 2): (1, 0, 3, 4, 5, 2),\n", + " (1, 0, 3, 5, 2, 4): (1, 0, 3, 5, 2, 4),\n", + " (1, 0, 3, 5, 4, 2): (1, 0, 3, 5, 4, 2),\n", + " (1, 0, 4, 2, 3, 5): (1, 0, 4, 2, 3, 5),\n", + " (1, 0, 4, 2, 5, 3): (1, 0, 4, 2, 5, 3),\n", + " (1, 0, 4, 3, 2, 5): (1, 0, 4, 3, 2, 5),\n", + " (1, 0, 4, 3, 5, 2): (1, 0, 4, 3, 5, 2),\n", + " (1, 0, 4, 5, 2, 3): (1, 0, 4, 5, 2, 3),\n", + " (1, 0, 4, 5, 3, 2): (1, 0, 4, 5, 3, 2),\n", + " (1, 0, 5, 2, 3, 4): (1, 0, 5, 2, 3, 4),\n", + " (1, 0, 5, 2, 4, 3): (1, 0, 5, 2, 4, 3),\n", + " (1, 0, 5, 3, 2, 4): (1, 0, 5, 3, 2, 4),\n", + " (1, 0, 5, 3, 4, 2): (1, 0, 5, 3, 4, 2),\n", + " (1, 0, 5, 4, 2, 3): (1, 0, 5, 4, 2, 3),\n", + " (1, 0, 5, 4, 3, 2): (1, 0, 5, 4, 3, 2),\n", + " (1, 2, 0, 3, 4, 5): (1, 2, 0, 3, 4, 5),\n", + " (1, 2, 0, 3, 5, 4): (1, 2, 0, 3, 5, 4),\n", + " (1, 2, 0, 4, 3, 5): (1, 2, 0, 4, 3, 5),\n", + " (1, 2, 0, 4, 5, 3): (1, 2, 0, 4, 5, 3),\n", + " (1, 2, 0, 5, 3, 4): (1, 2, 0, 5, 3, 4),\n", + " (1, 2, 0, 5, 4, 3): (1, 2, 0, 5, 4, 3),\n", + " (1, 2, 3, 0, 4, 5): (1, 2, 3, 0, 4, 5),\n", + " (1, 2, 3, 0, 5, 4): (1, 2, 3, 0, 5, 4),\n", + " (1, 2, 3, 4, 0, 5): (1, 2, 3, 4, 0, 5),\n", + " (1, 2, 3, 4, 5, 0): (1, 2, 3, 4, 5, 0),\n", + " (1, 2, 3, 5, 0, 4): (1, 2, 3, 5, 0, 4),\n", + " (1, 2, 3, 5, 4, 0): (1, 2, 3, 5, 4, 0),\n", + " (1, 2, 4, 0, 3, 5): (1, 2, 4, 0, 3, 5),\n", + " (1, 2, 4, 0, 5, 3): (1, 2, 4, 0, 5, 3),\n", + " (1, 2, 4, 3, 0, 5): (1, 2, 4, 3, 0, 5),\n", + " (1, 2, 4, 3, 5, 0): (1, 2, 4, 3, 5, 0),\n", + " (1, 2, 4, 5, 0, 3): (1, 2, 4, 5, 0, 3),\n", + " (1, 2, 4, 5, 3, 0): (1, 2, 4, 5, 3, 0),\n", + " (1, 2, 5, 0, 3, 4): (1, 2, 5, 0, 3, 4),\n", + " (1, 2, 5, 0, 4, 3): (1, 2, 5, 0, 4, 3),\n", + " (1, 2, 5, 3, 0, 4): (1, 2, 5, 3, 0, 4),\n", + " (1, 2, 5, 3, 4, 0): (1, 2, 5, 3, 4, 0),\n", + " (1, 2, 5, 4, 0, 3): (1, 2, 5, 4, 0, 3),\n", + " (1, 2, 5, 4, 3, 0): (1, 2, 5, 4, 3, 0),\n", + " (1, 3, 0, 2, 4, 5): (1, 3, 0, 2, 4, 5),\n", + " (1, 3, 0, 2, 5, 4): (1, 3, 0, 2, 5, 4),\n", + " (1, 3, 0, 4, 2, 5): (1, 3, 0, 4, 2, 5),\n", + " (1, 3, 0, 4, 5, 2): (1, 3, 0, 4, 5, 2),\n", + " (1, 3, 0, 5, 2, 4): (1, 3, 0, 5, 2, 4),\n", + " (1, 3, 0, 5, 4, 2): (1, 3, 0, 5, 4, 2),\n", + " (1, 3, 2, 0, 4, 5): (1, 3, 2, 0, 4, 5),\n", + " (1, 3, 2, 0, 5, 4): (1, 3, 2, 0, 5, 4),\n", + " (1, 3, 2, 4, 0, 5): (1, 3, 2, 4, 0, 5),\n", + " (1, 3, 2, 4, 5, 0): (1, 3, 2, 4, 5, 0),\n", + " (1, 3, 2, 5, 0, 4): (1, 3, 2, 5, 0, 4),\n", + " (1, 3, 2, 5, 4, 0): (1, 3, 2, 5, 4, 0),\n", + " (1, 3, 4, 0, 2, 5): (1, 3, 4, 0, 2, 5),\n", + " (1, 3, 4, 0, 5, 2): (1, 3, 4, 0, 5, 2),\n", + " (1, 3, 4, 2, 0, 5): (1, 3, 4, 2, 0, 5),\n", + " (1, 3, 4, 2, 5, 0): (1, 3, 4, 2, 5, 0),\n", + " (1, 3, 4, 5, 0, 2): (1, 3, 4, 5, 0, 2),\n", + " (1, 3, 4, 5, 2, 0): (1, 3, 4, 5, 2, 0),\n", + " (1, 3, 5, 0, 2, 4): (1, 3, 5, 0, 2, 4),\n", + " (1, 3, 5, 0, 4, 2): (1, 3, 5, 0, 4, 2),\n", + " (1, 3, 5, 2, 0, 4): (1, 3, 5, 2, 0, 4),\n", + " (1, 3, 5, 2, 4, 0): (1, 3, 5, 2, 4, 0),\n", + " (1, 3, 5, 4, 0, 2): (1, 3, 5, 4, 0, 2),\n", + " (1, 3, 5, 4, 2, 0): (1, 3, 5, 4, 2, 0),\n", + " (1, 4, 0, 2, 3, 5): (1, 4, 0, 2, 3, 5),\n", + " (1, 4, 0, 2, 5, 3): (1, 4, 0, 2, 5, 3),\n", + " (1, 4, 0, 3, 2, 5): (1, 4, 0, 3, 2, 5),\n", + " (1, 4, 0, 3, 5, 2): (1, 4, 0, 3, 5, 2),\n", + " (1, 4, 0, 5, 2, 3): (1, 4, 0, 5, 2, 3),\n", + " (1, 4, 0, 5, 3, 2): (1, 4, 0, 5, 3, 2),\n", + " (1, 4, 2, 0, 3, 5): (1, 4, 2, 0, 3, 5),\n", + " (1, 4, 2, 0, 5, 3): (1, 4, 2, 0, 5, 3),\n", + " (1, 4, 2, 3, 0, 5): (1, 4, 2, 3, 0, 5),\n", + " (1, 4, 2, 3, 5, 0): (1, 4, 2, 3, 5, 0),\n", + " (1, 4, 2, 5, 0, 3): (1, 4, 2, 5, 0, 3),\n", + " (1, 4, 2, 5, 3, 0): (1, 4, 2, 5, 3, 0),\n", + " (1, 4, 3, 0, 2, 5): (1, 4, 3, 0, 2, 5),\n", + " (1, 4, 3, 0, 5, 2): (1, 4, 3, 0, 5, 2),\n", + " (1, 4, 3, 2, 0, 5): (1, 4, 3, 2, 0, 5),\n", + " (1, 4, 3, 2, 5, 0): (1, 4, 3, 2, 5, 0),\n", + " (1, 4, 3, 5, 0, 2): (1, 4, 3, 5, 0, 2),\n", + " (1, 4, 3, 5, 2, 0): (1, 4, 3, 5, 2, 0),\n", + " (1, 4, 5, 0, 2, 3): (1, 4, 5, 0, 2, 3),\n", + " (1, 4, 5, 0, 3, 2): (1, 4, 5, 0, 3, 2),\n", + " (1, 4, 5, 2, 0, 3): (1, 4, 5, 2, 0, 3),\n", + " (1, 4, 5, 2, 3, 0): (1, 4, 5, 2, 3, 0),\n", + " (1, 4, 5, 3, 0, 2): (1, 4, 5, 3, 0, 2),\n", + " (1, 4, 5, 3, 2, 0): (1, 4, 5, 3, 2, 0),\n", + " (1, 5, 0, 2, 3, 4): (1, 5, 0, 2, 3, 4),\n", + " (1, 5, 0, 2, 4, 3): (1, 5, 0, 2, 4, 3),\n", + " (1, 5, 0, 3, 2, 4): (1, 5, 0, 3, 2, 4),\n", + " (1, 5, 0, 3, 4, 2): (1, 5, 0, 3, 4, 2),\n", + " (1, 5, 0, 4, 2, 3): (1, 5, 0, 4, 2, 3),\n", + " (1, 5, 0, 4, 3, 2): (1, 5, 0, 4, 3, 2),\n", + " (1, 5, 2, 0, 3, 4): (1, 5, 2, 0, 3, 4),\n", + " (1, 5, 2, 0, 4, 3): (1, 5, 2, 0, 4, 3),\n", + " (1, 5, 2, 3, 0, 4): (1, 5, 2, 3, 0, 4),\n", + " (1, 5, 2, 3, 4, 0): (1, 5, 2, 3, 4, 0),\n", + " (1, 5, 2, 4, 0, 3): (1, 5, 2, 4, 0, 3),\n", + " (1, 5, 2, 4, 3, 0): (1, 5, 2, 4, 3, 0),\n", + " (1, 5, 3, 0, 2, 4): (1, 5, 3, 0, 2, 4),\n", + " (1, 5, 3, 0, 4, 2): (1, 5, 3, 0, 4, 2),\n", + " (1, 5, 3, 2, 0, 4): (1, 5, 3, 2, 0, 4),\n", + " (1, 5, 3, 2, 4, 0): (1, 5, 3, 2, 4, 0),\n", + " (1, 5, 3, 4, 0, 2): (1, 5, 3, 4, 0, 2),\n", + " (1, 5, 3, 4, 2, 0): (1, 5, 3, 4, 2, 0),\n", + " (1, 5, 4, 0, 2, 3): (1, 5, 4, 0, 2, 3),\n", + " (1, 5, 4, 0, 3, 2): (1, 5, 4, 0, 3, 2),\n", + " (1, 5, 4, 2, 0, 3): (1, 5, 4, 2, 0, 3),\n", + " (1, 5, 4, 2, 3, 0): (1, 5, 4, 2, 3, 0),\n", + " (1, 5, 4, 3, 0, 2): (1, 5, 4, 3, 0, 2),\n", + " (1, 5, 4, 3, 2, 0): (1, 5, 4, 3, 2, 0),\n", + " (2, 0, 1, 3, 4, 5): (2, 0, 1, 3, 4, 5),\n", + " (2, 0, 1, 3, 5, 4): (2, 0, 1, 3, 5, 4),\n", + " (2, 0, 1, 4, 3, 5): (2, 0, 1, 4, 3, 5),\n", + " (2, 0, 1, 4, 5, 3): (2, 0, 1, 4, 5, 3),\n", + " (2, 0, 1, 5, 3, 4): (2, 0, 1, 5, 3, 4),\n", + " (2, 0, 1, 5, 4, 3): (2, 0, 1, 5, 4, 3),\n", + " (2, 0, 3, 1, 4, 5): (2, 0, 3, 1, 4, 5),\n", + " (2, 0, 3, 1, 5, 4): (2, 0, 3, 1, 5, 4),\n", + " (2, 0, 3, 4, 1, 5): (2, 0, 3, 4, 1, 5),\n", + " (2, 0, 3, 4, 5, 1): (2, 0, 3, 4, 5, 1),\n", + " (2, 0, 3, 5, 1, 4): (2, 0, 3, 5, 1, 4),\n", + " (2, 0, 3, 5, 4, 1): (2, 0, 3, 5, 4, 1),\n", + " (2, 0, 4, 1, 3, 5): (2, 0, 4, 1, 3, 5),\n", + " (2, 0, 4, 1, 5, 3): (2, 0, 4, 1, 5, 3),\n", + " (2, 0, 4, 3, 1, 5): (2, 0, 4, 3, 1, 5),\n", + " (2, 0, 4, 3, 5, 1): (2, 0, 4, 3, 5, 1),\n", + " (2, 0, 4, 5, 1, 3): (2, 0, 4, 5, 1, 3),\n", + " (2, 0, 4, 5, 3, 1): (2, 0, 4, 5, 3, 1),\n", + " (2, 0, 5, 1, 3, 4): (2, 0, 5, 1, 3, 4),\n", + " (2, 0, 5, 1, 4, 3): (2, 0, 5, 1, 4, 3),\n", + " (2, 0, 5, 3, 1, 4): (2, 0, 5, 3, 1, 4),\n", + " (2, 0, 5, 3, 4, 1): (2, 0, 5, 3, 4, 1),\n", + " (2, 0, 5, 4, 1, 3): (2, 0, 5, 4, 1, 3),\n", + " (2, 0, 5, 4, 3, 1): (2, 0, 5, 4, 3, 1),\n", + " (2, 1, 0, 3, 4, 5): (2, 1, 0, 3, 4, 5),\n", + " (2, 1, 0, 3, 5, 4): (2, 1, 0, 3, 5, 4),\n", + " (2, 1, 0, 4, 3, 5): (2, 1, 0, 4, 3, 5),\n", + " (2, 1, 0, 4, 5, 3): (2, 1, 0, 4, 5, 3),\n", + " (2, 1, 0, 5, 3, 4): (2, 1, 0, 5, 3, 4),\n", + " (2, 1, 0, 5, 4, 3): (2, 1, 0, 5, 4, 3),\n", + " (2, 1, 3, 0, 4, 5): (2, 1, 3, 0, 4, 5),\n", + " (2, 1, 3, 0, 5, 4): (2, 1, 3, 0, 5, 4),\n", + " (2, 1, 3, 4, 0, 5): (2, 1, 3, 4, 0, 5),\n", + " (2, 1, 3, 4, 5, 0): (2, 1, 3, 4, 5, 0),\n", + " (2, 1, 3, 5, 0, 4): (2, 1, 3, 5, 0, 4),\n", + " (2, 1, 3, 5, 4, 0): (2, 1, 3, 5, 4, 0),\n", + " (2, 1, 4, 0, 3, 5): (2, 1, 4, 0, 3, 5),\n", + " (2, 1, 4, 0, 5, 3): (2, 1, 4, 0, 5, 3),\n", + " (2, 1, 4, 3, 0, 5): (2, 1, 4, 3, 0, 5),\n", + " (2, 1, 4, 3, 5, 0): (2, 1, 4, 3, 5, 0),\n", + " (2, 1, 4, 5, 0, 3): (2, 1, 4, 5, 0, 3),\n", + " (2, 1, 4, 5, 3, 0): (2, 1, 4, 5, 3, 0),\n", + " (2, 1, 5, 0, 3, 4): (2, 1, 5, 0, 3, 4),\n", + " (2, 1, 5, 0, 4, 3): (2, 1, 5, 0, 4, 3),\n", + " (2, 1, 5, 3, 0, 4): (2, 1, 5, 3, 0, 4),\n", + " (2, 1, 5, 3, 4, 0): (2, 1, 5, 3, 4, 0),\n", + " (2, 1, 5, 4, 0, 3): (2, 1, 5, 4, 0, 3),\n", + " (2, 1, 5, 4, 3, 0): (2, 1, 5, 4, 3, 0),\n", + " (2, 3, 0, 1, 4, 5): (2, 3, 0, 1, 4, 5),\n", + " (2, 3, 0, 1, 5, 4): (2, 3, 0, 1, 5, 4),\n", + " (2, 3, 0, 4, 1, 5): (2, 3, 0, 4, 1, 5),\n", + " (2, 3, 0, 4, 5, 1): (2, 3, 0, 4, 5, 1),\n", + " (2, 3, 0, 5, 1, 4): (2, 3, 0, 5, 1, 4),\n", + " (2, 3, 0, 5, 4, 1): (2, 3, 0, 5, 4, 1),\n", + " (2, 3, 1, 0, 4, 5): (2, 3, 1, 0, 4, 5),\n", + " (2, 3, 1, 0, 5, 4): (2, 3, 1, 0, 5, 4),\n", + " (2, 3, 1, 4, 0, 5): (2, 3, 1, 4, 0, 5),\n", + " (2, 3, 1, 4, 5, 0): (2, 3, 1, 4, 5, 0),\n", + " (2, 3, 1, 5, 0, 4): (2, 3, 1, 5, 0, 4),\n", + " (2, 3, 1, 5, 4, 0): (2, 3, 1, 5, 4, 0),\n", + " (2, 3, 4, 0, 1, 5): (2, 3, 4, 0, 1, 5),\n", + " (2, 3, 4, 0, 5, 1): (2, 3, 4, 0, 5, 1),\n", + " (2, 3, 4, 1, 0, 5): (2, 3, 4, 1, 0, 5),\n", + " (2, 3, 4, 1, 5, 0): (2, 3, 4, 1, 5, 0),\n", + " (2, 3, 4, 5, 0, 1): (2, 3, 4, 5, 0, 1),\n", + " (2, 3, 4, 5, 1, 0): (2, 3, 4, 5, 1, 0),\n", + " (2, 3, 5, 0, 1, 4): (2, 3, 5, 0, 1, 4),\n", + " (2, 3, 5, 0, 4, 1): (2, 3, 5, 0, 4, 1),\n", + " (2, 3, 5, 1, 0, 4): (2, 3, 5, 1, 0, 4),\n", + " (2, 3, 5, 1, 4, 0): (2, 3, 5, 1, 4, 0),\n", + " (2, 3, 5, 4, 0, 1): (2, 3, 5, 4, 0, 1),\n", + " (2, 3, 5, 4, 1, 0): (2, 3, 5, 4, 1, 0),\n", + " (2, 4, 0, 1, 3, 5): (2, 4, 0, 1, 3, 5),\n", + " (2, 4, 0, 1, 5, 3): (2, 4, 0, 1, 5, 3),\n", + " (2, 4, 0, 3, 1, 5): (2, 4, 0, 3, 1, 5),\n", + " (2, 4, 0, 3, 5, 1): (2, 4, 0, 3, 5, 1),\n", + " (2, 4, 0, 5, 1, 3): (2, 4, 0, 5, 1, 3),\n", + " (2, 4, 0, 5, 3, 1): (2, 4, 0, 5, 3, 1),\n", + " (2, 4, 1, 0, 3, 5): (2, 4, 1, 0, 3, 5),\n", + " (2, 4, 1, 0, 5, 3): (2, 4, 1, 0, 5, 3),\n", + " (2, 4, 1, 3, 0, 5): (2, 4, 1, 3, 0, 5),\n", + " (2, 4, 1, 3, 5, 0): (2, 4, 1, 3, 5, 0),\n", + " (2, 4, 1, 5, 0, 3): (2, 4, 1, 5, 0, 3),\n", + " (2, 4, 1, 5, 3, 0): (2, 4, 1, 5, 3, 0),\n", + " (2, 4, 3, 0, 1, 5): (2, 4, 3, 0, 1, 5),\n", + " (2, 4, 3, 0, 5, 1): (2, 4, 3, 0, 5, 1),\n", + " (2, 4, 3, 1, 0, 5): (2, 4, 3, 1, 0, 5),\n", + " (2, 4, 3, 1, 5, 0): (2, 4, 3, 1, 5, 0),\n", + " (2, 4, 3, 5, 0, 1): (2, 4, 3, 5, 0, 1),\n", + " (2, 4, 3, 5, 1, 0): (2, 4, 3, 5, 1, 0),\n", + " (2, 4, 5, 0, 1, 3): (2, 4, 5, 0, 1, 3),\n", + " (2, 4, 5, 0, 3, 1): (2, 4, 5, 0, 3, 1),\n", + " (2, 4, 5, 1, 0, 3): (2, 4, 5, 1, 0, 3),\n", + " (2, 4, 5, 1, 3, 0): (2, 4, 5, 1, 3, 0),\n", + " (2, 4, 5, 3, 0, 1): (2, 4, 5, 3, 0, 1),\n", + " (2, 4, 5, 3, 1, 0): (2, 4, 5, 3, 1, 0),\n", + " (2, 5, 0, 1, 3, 4): (2, 5, 0, 1, 3, 4),\n", + " (2, 5, 0, 1, 4, 3): (2, 5, 0, 1, 4, 3),\n", + " (2, 5, 0, 3, 1, 4): (2, 5, 0, 3, 1, 4),\n", + " (2, 5, 0, 3, 4, 1): (2, 5, 0, 3, 4, 1),\n", + " (2, 5, 0, 4, 1, 3): (2, 5, 0, 4, 1, 3),\n", + " (2, 5, 0, 4, 3, 1): (2, 5, 0, 4, 3, 1),\n", + " (2, 5, 1, 0, 3, 4): (2, 5, 1, 0, 3, 4),\n", + " (2, 5, 1, 0, 4, 3): (2, 5, 1, 0, 4, 3),\n", + " (2, 5, 1, 3, 0, 4): (2, 5, 1, 3, 0, 4),\n", + " (2, 5, 1, 3, 4, 0): (2, 5, 1, 3, 4, 0),\n", + " (2, 5, 1, 4, 0, 3): (2, 5, 1, 4, 0, 3),\n", + " (2, 5, 1, 4, 3, 0): (2, 5, 1, 4, 3, 0),\n", + " (2, 5, 3, 0, 1, 4): (2, 5, 3, 0, 1, 4),\n", + " (2, 5, 3, 0, 4, 1): (2, 5, 3, 0, 4, 1),\n", + " (2, 5, 3, 1, 0, 4): (2, 5, 3, 1, 0, 4),\n", + " (2, 5, 3, 1, 4, 0): (2, 5, 3, 1, 4, 0),\n", + " (2, 5, 3, 4, 0, 1): (2, 5, 3, 4, 0, 1),\n", + " (2, 5, 3, 4, 1, 0): (2, 5, 3, 4, 1, 0),\n", + " (2, 5, 4, 0, 1, 3): (2, 5, 4, 0, 1, 3),\n", + " (2, 5, 4, 0, 3, 1): (2, 5, 4, 0, 3, 1),\n", + " (2, 5, 4, 1, 0, 3): (2, 5, 4, 1, 0, 3),\n", + " (2, 5, 4, 1, 3, 0): (2, 5, 4, 1, 3, 0),\n", + " (2, 5, 4, 3, 0, 1): (2, 5, 4, 3, 0, 1),\n", + " (2, 5, 4, 3, 1, 0): (2, 5, 4, 3, 1, 0),\n", + " (3, 0, 1, 2, 4, 5): (3, 0, 1, 2, 4, 5),\n", + " (3, 0, 1, 2, 5, 4): (3, 0, 1, 2, 5, 4),\n", + " (3, 0, 1, 4, 2, 5): (3, 0, 1, 4, 2, 5),\n", + " (3, 0, 1, 4, 5, 2): (3, 0, 1, 4, 5, 2),\n", + " (3, 0, 1, 5, 2, 4): (3, 0, 1, 5, 2, 4),\n", + " (3, 0, 1, 5, 4, 2): (3, 0, 1, 5, 4, 2),\n", + " (3, 0, 2, 1, 4, 5): (3, 0, 2, 1, 4, 5),\n", + " (3, 0, 2, 1, 5, 4): (3, 0, 2, 1, 5, 4),\n", + " (3, 0, 2, 4, 1, 5): (3, 0, 2, 4, 1, 5),\n", + " (3, 0, 2, 4, 5, 1): (3, 0, 2, 4, 5, 1),\n", + " (3, 0, 2, 5, 1, 4): (3, 0, 2, 5, 1, 4),\n", + " (3, 0, 2, 5, 4, 1): (3, 0, 2, 5, 4, 1),\n", + " (3, 0, 4, 1, 2, 5): (3, 0, 4, 1, 2, 5),\n", + " (3, 0, 4, 1, 5, 2): (3, 0, 4, 1, 5, 2),\n", + " (3, 0, 4, 2, 1, 5): (3, 0, 4, 2, 1, 5),\n", + " (3, 0, 4, 2, 5, 1): (3, 0, 4, 2, 5, 1),\n", + " (3, 0, 4, 5, 1, 2): (3, 0, 4, 5, 1, 2),\n", + " (3, 0, 4, 5, 2, 1): (3, 0, 4, 5, 2, 1),\n", + " (3, 0, 5, 1, 2, 4): (3, 0, 5, 1, 2, 4),\n", + " (3, 0, 5, 1, 4, 2): (3, 0, 5, 1, 4, 2),\n", + " (3, 0, 5, 2, 1, 4): (3, 0, 5, 2, 1, 4),\n", + " (3, 0, 5, 2, 4, 1): (3, 0, 5, 2, 4, 1),\n", + " (3, 0, 5, 4, 1, 2): (3, 0, 5, 4, 1, 2),\n", + " (3, 0, 5, 4, 2, 1): (3, 0, 5, 4, 2, 1),\n", + " (3, 1, 0, 2, 4, 5): (3, 1, 0, 2, 4, 5),\n", + " (3, 1, 0, 2, 5, 4): (3, 1, 0, 2, 5, 4),\n", + " (3, 1, 0, 4, 2, 5): (3, 1, 0, 4, 2, 5),\n", + " (3, 1, 0, 4, 5, 2): (3, 1, 0, 4, 5, 2),\n", + " (3, 1, 0, 5, 2, 4): (3, 1, 0, 5, 2, 4),\n", + " (3, 1, 0, 5, 4, 2): (3, 1, 0, 5, 4, 2),\n", + " (3, 1, 2, 0, 4, 5): (3, 1, 2, 0, 4, 5),\n", + " (3, 1, 2, 0, 5, 4): (3, 1, 2, 0, 5, 4),\n", + " (3, 1, 2, 4, 0, 5): (3, 1, 2, 4, 0, 5),\n", + " (3, 1, 2, 4, 5, 0): (3, 1, 2, 4, 5, 0),\n", + " (3, 1, 2, 5, 0, 4): (3, 1, 2, 5, 0, 4),\n", + " (3, 1, 2, 5, 4, 0): (3, 1, 2, 5, 4, 0),\n", + " (3, 1, 4, 0, 2, 5): (3, 1, 4, 0, 2, 5),\n", + " (3, 1, 4, 0, 5, 2): (3, 1, 4, 0, 5, 2),\n", + " (3, 1, 4, 2, 0, 5): (3, 1, 4, 2, 0, 5),\n", + " (3, 1, 4, 2, 5, 0): (3, 1, 4, 2, 5, 0),\n", + " (3, 1, 4, 5, 0, 2): (3, 1, 4, 5, 0, 2),\n", + " (3, 1, 4, 5, 2, 0): (3, 1, 4, 5, 2, 0),\n", + " (3, 1, 5, 0, 2, 4): (3, 1, 5, 0, 2, 4),\n", + " (3, 1, 5, 0, 4, 2): (3, 1, 5, 0, 4, 2),\n", + " (3, 1, 5, 2, 0, 4): (3, 1, 5, 2, 0, 4),\n", + " (3, 1, 5, 2, 4, 0): (3, 1, 5, 2, 4, 0),\n", + " (3, 1, 5, 4, 0, 2): (3, 1, 5, 4, 0, 2),\n", + " (3, 1, 5, 4, 2, 0): (3, 1, 5, 4, 2, 0),\n", + " (3, 2, 0, 1, 4, 5): (3, 2, 0, 1, 4, 5),\n", + " (3, 2, 0, 1, 5, 4): (3, 2, 0, 1, 5, 4),\n", + " (3, 2, 0, 4, 1, 5): (3, 2, 0, 4, 1, 5),\n", + " (3, 2, 0, 4, 5, 1): (3, 2, 0, 4, 5, 1),\n", + " (3, 2, 0, 5, 1, 4): (3, 2, 0, 5, 1, 4),\n", + " (3, 2, 0, 5, 4, 1): (3, 2, 0, 5, 4, 1),\n", + " (3, 2, 1, 0, 4, 5): (3, 2, 1, 0, 4, 5),\n", + " (3, 2, 1, 0, 5, 4): (3, 2, 1, 0, 5, 4),\n", + " (3, 2, 1, 4, 0, 5): (3, 2, 1, 4, 0, 5),\n", + " (3, 2, 1, 4, 5, 0): (3, 2, 1, 4, 5, 0),\n", + " (3, 2, 1, 5, 0, 4): (3, 2, 1, 5, 0, 4),\n", + " (3, 2, 1, 5, 4, 0): (3, 2, 1, 5, 4, 0),\n", + " (3, 2, 4, 0, 1, 5): (3, 2, 4, 0, 1, 5),\n", + " (3, 2, 4, 0, 5, 1): (3, 2, 4, 0, 5, 1),\n", + " (3, 2, 4, 1, 0, 5): (3, 2, 4, 1, 0, 5),\n", + " (3, 2, 4, 1, 5, 0): (3, 2, 4, 1, 5, 0),\n", + " (3, 2, 4, 5, 0, 1): (3, 2, 4, 5, 0, 1),\n", + " (3, 2, 4, 5, 1, 0): (3, 2, 4, 5, 1, 0),\n", + " (3, 2, 5, 0, 1, 4): (3, 2, 5, 0, 1, 4),\n", + " (3, 2, 5, 0, 4, 1): (3, 2, 5, 0, 4, 1),\n", + " (3, 2, 5, 1, 0, 4): (3, 2, 5, 1, 0, 4),\n", + " (3, 2, 5, 1, 4, 0): (3, 2, 5, 1, 4, 0),\n", + " (3, 2, 5, 4, 0, 1): (3, 2, 5, 4, 0, 1),\n", + " (3, 2, 5, 4, 1, 0): (3, 2, 5, 4, 1, 0),\n", + " (3, 4, 0, 1, 2, 5): (3, 4, 0, 1, 2, 5),\n", + " (3, 4, 0, 1, 5, 2): (3, 4, 0, 1, 5, 2),\n", + " (3, 4, 0, 2, 1, 5): (3, 4, 0, 2, 1, 5),\n", + " (3, 4, 0, 2, 5, 1): (3, 4, 0, 2, 5, 1),\n", + " (3, 4, 0, 5, 1, 2): (3, 4, 0, 5, 1, 2),\n", + " (3, 4, 0, 5, 2, 1): (3, 4, 0, 5, 2, 1),\n", + " (3, 4, 1, 0, 2, 5): (3, 4, 1, 0, 2, 5),\n", + " (3, 4, 1, 0, 5, 2): (3, 4, 1, 0, 5, 2),\n", + " (3, 4, 1, 2, 0, 5): (3, 4, 1, 2, 0, 5),\n", + " (3, 4, 1, 2, 5, 0): (3, 4, 1, 2, 5, 0),\n", + " (3, 4, 1, 5, 0, 2): (3, 4, 1, 5, 0, 2),\n", + " (3, 4, 1, 5, 2, 0): (3, 4, 1, 5, 2, 0),\n", + " (3, 4, 2, 0, 1, 5): (3, 4, 2, 0, 1, 5),\n", + " (3, 4, 2, 0, 5, 1): (3, 4, 2, 0, 5, 1),\n", + " (3, 4, 2, 1, 0, 5): (3, 4, 2, 1, 0, 5),\n", + " (3, 4, 2, 1, 5, 0): (3, 4, 2, 1, 5, 0),\n", + " (3, 4, 2, 5, 0, 1): (3, 4, 2, 5, 0, 1),\n", + " (3, 4, 2, 5, 1, 0): (3, 4, 2, 5, 1, 0),\n", + " (3, 4, 5, 0, 1, 2): (3, 4, 5, 0, 1, 2),\n", + " (3, 4, 5, 0, 2, 1): (3, 4, 5, 0, 2, 1),\n", + " (3, 4, 5, 1, 0, 2): (3, 4, 5, 1, 0, 2),\n", + " (3, 4, 5, 1, 2, 0): (3, 4, 5, 1, 2, 0),\n", + " (3, 4, 5, 2, 0, 1): (3, 4, 5, 2, 0, 1),\n", + " (3, 4, 5, 2, 1, 0): (3, 4, 5, 2, 1, 0),\n", + " (3, 5, 0, 1, 2, 4): (3, 5, 0, 1, 2, 4),\n", + " (3, 5, 0, 1, 4, 2): (3, 5, 0, 1, 4, 2),\n", + " (3, 5, 0, 2, 1, 4): (3, 5, 0, 2, 1, 4),\n", + " (3, 5, 0, 2, 4, 1): (3, 5, 0, 2, 4, 1),\n", + " (3, 5, 0, 4, 1, 2): (3, 5, 0, 4, 1, 2),\n", + " (3, 5, 0, 4, 2, 1): (3, 5, 0, 4, 2, 1),\n", + " (3, 5, 1, 0, 2, 4): (3, 5, 1, 0, 2, 4),\n", + " (3, 5, 1, 0, 4, 2): (3, 5, 1, 0, 4, 2),\n", + " (3, 5, 1, 2, 0, 4): (3, 5, 1, 2, 0, 4),\n", + " (3, 5, 1, 2, 4, 0): (3, 5, 1, 2, 4, 0),\n", + " (3, 5, 1, 4, 0, 2): (3, 5, 1, 4, 0, 2),\n", + " (3, 5, 1, 4, 2, 0): (3, 5, 1, 4, 2, 0),\n", + " (3, 5, 2, 0, 1, 4): (3, 5, 2, 0, 1, 4),\n", + " (3, 5, 2, 0, 4, 1): (3, 5, 2, 0, 4, 1),\n", + " (3, 5, 2, 1, 0, 4): (3, 5, 2, 1, 0, 4),\n", + " (3, 5, 2, 1, 4, 0): (3, 5, 2, 1, 4, 0),\n", + " (3, 5, 2, 4, 0, 1): (3, 5, 2, 4, 0, 1),\n", + " (3, 5, 2, 4, 1, 0): (3, 5, 2, 4, 1, 0),\n", + " (3, 5, 4, 0, 1, 2): (3, 5, 4, 0, 1, 2),\n", + " (3, 5, 4, 0, 2, 1): (3, 5, 4, 0, 2, 1),\n", + " (3, 5, 4, 1, 0, 2): (3, 5, 4, 1, 0, 2),\n", + " (3, 5, 4, 1, 2, 0): (3, 5, 4, 1, 2, 0),\n", + " (3, 5, 4, 2, 0, 1): (3, 5, 4, 2, 0, 1),\n", + " (3, 5, 4, 2, 1, 0): (3, 5, 4, 2, 1, 0),\n", + " (4, 0, 1, 2, 3, 5): (4, 0, 1, 2, 3, 5),\n", + " (4, 0, 1, 2, 5, 3): (4, 0, 1, 2, 5, 3),\n", + " (4, 0, 1, 3, 2, 5): (4, 0, 1, 3, 2, 5),\n", + " (4, 0, 1, 3, 5, 2): (4, 0, 1, 3, 5, 2),\n", + " (4, 0, 1, 5, 2, 3): (4, 0, 1, 5, 2, 3),\n", + " (4, 0, 1, 5, 3, 2): (4, 0, 1, 5, 3, 2),\n", + " (4, 0, 2, 1, 3, 5): (4, 0, 2, 1, 3, 5),\n", + " (4, 0, 2, 1, 5, 3): (4, 0, 2, 1, 5, 3),\n", + " (4, 0, 2, 3, 1, 5): (4, 0, 2, 3, 1, 5),\n", + " (4, 0, 2, 3, 5, 1): (4, 0, 2, 3, 5, 1),\n", + " (4, 0, 2, 5, 1, 3): (4, 0, 2, 5, 1, 3),\n", + " (4, 0, 2, 5, 3, 1): (4, 0, 2, 5, 3, 1),\n", + " (4, 0, 3, 1, 2, 5): (4, 0, 3, 1, 2, 5),\n", + " (4, 0, 3, 1, 5, 2): (4, 0, 3, 1, 5, 2),\n", + " (4, 0, 3, 2, 1, 5): (4, 0, 3, 2, 1, 5),\n", + " (4, 0, 3, 2, 5, 1): (4, 0, 3, 2, 5, 1),\n", + " (4, 0, 3, 5, 1, 2): (4, 0, 3, 5, 1, 2),\n", + " (4, 0, 3, 5, 2, 1): (4, 0, 3, 5, 2, 1),\n", + " (4, 0, 5, 1, 2, 3): (4, 0, 5, 1, 2, 3),\n", + " (4, 0, 5, 1, 3, 2): (4, 0, 5, 1, 3, 2),\n", + " (4, 0, 5, 2, 1, 3): (4, 0, 5, 2, 1, 3),\n", + " (4, 0, 5, 2, 3, 1): (4, 0, 5, 2, 3, 1),\n", + " (4, 0, 5, 3, 1, 2): (4, 0, 5, 3, 1, 2),\n", + " (4, 0, 5, 3, 2, 1): (4, 0, 5, 3, 2, 1),\n", + " (4, 1, 0, 2, 3, 5): (4, 1, 0, 2, 3, 5),\n", + " (4, 1, 0, 2, 5, 3): (4, 1, 0, 2, 5, 3),\n", + " (4, 1, 0, 3, 2, 5): (4, 1, 0, 3, 2, 5),\n", + " (4, 1, 0, 3, 5, 2): (4, 1, 0, 3, 5, 2),\n", + " (4, 1, 0, 5, 2, 3): (4, 1, 0, 5, 2, 3),\n", + " (4, 1, 0, 5, 3, 2): (4, 1, 0, 5, 3, 2),\n", + " (4, 1, 2, 0, 3, 5): (4, 1, 2, 0, 3, 5),\n", + " (4, 1, 2, 0, 5, 3): (4, 1, 2, 0, 5, 3),\n", + " (4, 1, 2, 3, 0, 5): (4, 1, 2, 3, 0, 5),\n", + " (4, 1, 2, 3, 5, 0): (4, 1, 2, 3, 5, 0),\n", + " (4, 1, 2, 5, 0, 3): (4, 1, 2, 5, 0, 3),\n", + " (4, 1, 2, 5, 3, 0): (4, 1, 2, 5, 3, 0),\n", + " (4, 1, 3, 0, 2, 5): (4, 1, 3, 0, 2, 5),\n", + " (4, 1, 3, 0, 5, 2): (4, 1, 3, 0, 5, 2),\n", + " (4, 1, 3, 2, 0, 5): (4, 1, 3, 2, 0, 5),\n", + " (4, 1, 3, 2, 5, 0): (4, 1, 3, 2, 5, 0),\n", + " (4, 1, 3, 5, 0, 2): (4, 1, 3, 5, 0, 2),\n", + " (4, 1, 3, 5, 2, 0): (4, 1, 3, 5, 2, 0),\n", + " (4, 1, 5, 0, 2, 3): (4, 1, 5, 0, 2, 3),\n", + " (4, 1, 5, 0, 3, 2): (4, 1, 5, 0, 3, 2),\n", + " (4, 1, 5, 2, 0, 3): (4, 1, 5, 2, 0, 3),\n", + " (4, 1, 5, 2, 3, 0): (4, 1, 5, 2, 3, 0),\n", + " (4, 1, 5, 3, 0, 2): (4, 1, 5, 3, 0, 2),\n", + " (4, 1, 5, 3, 2, 0): (4, 1, 5, 3, 2, 0),\n", + " (4, 2, 0, 1, 3, 5): (4, 2, 0, 1, 3, 5),\n", + " (4, 2, 0, 1, 5, 3): (4, 2, 0, 1, 5, 3),\n", + " (4, 2, 0, 3, 1, 5): (4, 2, 0, 3, 1, 5),\n", + " (4, 2, 0, 3, 5, 1): (4, 2, 0, 3, 5, 1),\n", + " (4, 2, 0, 5, 1, 3): (4, 2, 0, 5, 1, 3),\n", + " (4, 2, 0, 5, 3, 1): (4, 2, 0, 5, 3, 1),\n", + " (4, 2, 1, 0, 3, 5): (4, 2, 1, 0, 3, 5),\n", + " (4, 2, 1, 0, 5, 3): (4, 2, 1, 0, 5, 3),\n", + " (4, 2, 1, 3, 0, 5): (4, 2, 1, 3, 0, 5),\n", + " (4, 2, 1, 3, 5, 0): (4, 2, 1, 3, 5, 0),\n", + " (4, 2, 1, 5, 0, 3): (4, 2, 1, 5, 0, 3),\n", + " (4, 2, 1, 5, 3, 0): (4, 2, 1, 5, 3, 0),\n", + " (4, 2, 3, 0, 1, 5): (4, 2, 3, 0, 1, 5),\n", + " (4, 2, 3, 0, 5, 1): (4, 2, 3, 0, 5, 1),\n", + " (4, 2, 3, 1, 0, 5): (4, 2, 3, 1, 0, 5),\n", + " (4, 2, 3, 1, 5, 0): (4, 2, 3, 1, 5, 0),\n", + " (4, 2, 3, 5, 0, 1): (4, 2, 3, 5, 0, 1),\n", + " (4, 2, 3, 5, 1, 0): (4, 2, 3, 5, 1, 0),\n", + " (4, 2, 5, 0, 1, 3): (4, 2, 5, 0, 1, 3),\n", + " (4, 2, 5, 0, 3, 1): (4, 2, 5, 0, 3, 1),\n", + " (4, 2, 5, 1, 0, 3): (4, 2, 5, 1, 0, 3),\n", + " (4, 2, 5, 1, 3, 0): (4, 2, 5, 1, 3, 0),\n", + " (4, 2, 5, 3, 0, 1): (4, 2, 5, 3, 0, 1),\n", + " (4, 2, 5, 3, 1, 0): (4, 2, 5, 3, 1, 0),\n", + " (4, 3, 0, 1, 2, 5): (4, 3, 0, 1, 2, 5),\n", + " (4, 3, 0, 1, 5, 2): (4, 3, 0, 1, 5, 2),\n", + " (4, 3, 0, 2, 1, 5): (4, 3, 0, 2, 1, 5),\n", + " (4, 3, 0, 2, 5, 1): (4, 3, 0, 2, 5, 1),\n", + " (4, 3, 0, 5, 1, 2): (4, 3, 0, 5, 1, 2),\n", + " (4, 3, 0, 5, 2, 1): (4, 3, 0, 5, 2, 1),\n", + " (4, 3, 1, 0, 2, 5): (4, 3, 1, 0, 2, 5),\n", + " (4, 3, 1, 0, 5, 2): (4, 3, 1, 0, 5, 2),\n", + " (4, 3, 1, 2, 0, 5): (4, 3, 1, 2, 0, 5),\n", + " (4, 3, 1, 2, 5, 0): (4, 3, 1, 2, 5, 0),\n", + " (4, 3, 1, 5, 0, 2): (4, 3, 1, 5, 0, 2),\n", + " (4, 3, 1, 5, 2, 0): (4, 3, 1, 5, 2, 0),\n", + " (4, 3, 2, 0, 1, 5): (4, 3, 2, 0, 1, 5),\n", + " (4, 3, 2, 0, 5, 1): (4, 3, 2, 0, 5, 1),\n", + " (4, 3, 2, 1, 0, 5): (4, 3, 2, 1, 0, 5),\n", + " (4, 3, 2, 1, 5, 0): (4, 3, 2, 1, 5, 0),\n", + " (4, 3, 2, 5, 0, 1): (4, 3, 2, 5, 0, 1),\n", + " (4, 3, 2, 5, 1, 0): (4, 3, 2, 5, 1, 0),\n", + " (4, 3, 5, 0, 1, 2): (4, 3, 5, 0, 1, 2),\n", + " (4, 3, 5, 0, 2, 1): (4, 3, 5, 0, 2, 1),\n", + " (4, 3, 5, 1, 0, 2): (4, 3, 5, 1, 0, 2),\n", + " (4, 3, 5, 1, 2, 0): (4, 3, 5, 1, 2, 0),\n", + " (4, 3, 5, 2, 0, 1): (4, 3, 5, 2, 0, 1),\n", + " (4, 3, 5, 2, 1, 0): (4, 3, 5, 2, 1, 0),\n", + " (4, 5, 0, 1, 2, 3): (4, 5, 0, 1, 2, 3),\n", + " (4, 5, 0, 1, 3, 2): (4, 5, 0, 1, 3, 2),\n", + " (4, 5, 0, 2, 1, 3): (4, 5, 0, 2, 1, 3),\n", + " (4, 5, 0, 2, 3, 1): (4, 5, 0, 2, 3, 1),\n", + " (4, 5, 0, 3, 1, 2): (4, 5, 0, 3, 1, 2),\n", + " (4, 5, 0, 3, 2, 1): (4, 5, 0, 3, 2, 1),\n", + " (4, 5, 1, 0, 2, 3): (4, 5, 1, 0, 2, 3),\n", + " (4, 5, 1, 0, 3, 2): (4, 5, 1, 0, 3, 2),\n", + " (4, 5, 1, 2, 0, 3): (4, 5, 1, 2, 0, 3),\n", + " (4, 5, 1, 2, 3, 0): (4, 5, 1, 2, 3, 0),\n", + " (4, 5, 1, 3, 0, 2): (4, 5, 1, 3, 0, 2),\n", + " (4, 5, 1, 3, 2, 0): (4, 5, 1, 3, 2, 0),\n", + " (4, 5, 2, 0, 1, 3): (4, 5, 2, 0, 1, 3),\n", + " (4, 5, 2, 0, 3, 1): (4, 5, 2, 0, 3, 1),\n", + " (4, 5, 2, 1, 0, 3): (4, 5, 2, 1, 0, 3),\n", + " (4, 5, 2, 1, 3, 0): (4, 5, 2, 1, 3, 0),\n", + " (4, 5, 2, 3, 0, 1): (4, 5, 2, 3, 0, 1),\n", + " (4, 5, 2, 3, 1, 0): (4, 5, 2, 3, 1, 0),\n", + " (4, 5, 3, 0, 1, 2): (4, 5, 3, 0, 1, 2),\n", + " (4, 5, 3, 0, 2, 1): (4, 5, 3, 0, 2, 1),\n", + " (4, 5, 3, 1, 0, 2): (4, 5, 3, 1, 0, 2),\n", + " (4, 5, 3, 1, 2, 0): (4, 5, 3, 1, 2, 0),\n", + " (4, 5, 3, 2, 0, 1): (4, 5, 3, 2, 0, 1),\n", + " (4, 5, 3, 2, 1, 0): (4, 5, 3, 2, 1, 0),\n", + " (5, 0, 1, 2, 3, 4): (5, 0, 1, 2, 3, 4),\n", + " (5, 0, 1, 2, 4, 3): (5, 0, 1, 2, 4, 3),\n", + " (5, 0, 1, 3, 2, 4): (5, 0, 1, 3, 2, 4),\n", + " (5, 0, 1, 3, 4, 2): (5, 0, 1, 3, 4, 2),\n", + " (5, 0, 1, 4, 2, 3): (5, 0, 1, 4, 2, 3),\n", + " (5, 0, 1, 4, 3, 2): (5, 0, 1, 4, 3, 2),\n", + " (5, 0, 2, 1, 3, 4): (5, 0, 2, 1, 3, 4),\n", + " (5, 0, 2, 1, 4, 3): (5, 0, 2, 1, 4, 3),\n", + " (5, 0, 2, 3, 1, 4): (5, 0, 2, 3, 1, 4),\n", + " (5, 0, 2, 3, 4, 1): (5, 0, 2, 3, 4, 1),\n", + " (5, 0, 2, 4, 1, 3): (5, 0, 2, 4, 1, 3),\n", + " (5, 0, 2, 4, 3, 1): (5, 0, 2, 4, 3, 1),\n", + " (5, 0, 3, 1, 2, 4): (5, 0, 3, 1, 2, 4),\n", + " (5, 0, 3, 1, 4, 2): (5, 0, 3, 1, 4, 2),\n", + " (5, 0, 3, 2, 1, 4): (5, 0, 3, 2, 1, 4),\n", + " (5, 0, 3, 2, 4, 1): (5, 0, 3, 2, 4, 1),\n", + " (5, 0, 3, 4, 1, 2): (5, 0, 3, 4, 1, 2),\n", + " (5, 0, 3, 4, 2, 1): (5, 0, 3, 4, 2, 1),\n", + " (5, 0, 4, 1, 2, 3): (5, 0, 4, 1, 2, 3),\n", + " (5, 0, 4, 1, 3, 2): (5, 0, 4, 1, 3, 2),\n", + " (5, 0, 4, 2, 1, 3): (5, 0, 4, 2, 1, 3),\n", + " (5, 0, 4, 2, 3, 1): (5, 0, 4, 2, 3, 1),\n", + " (5, 0, 4, 3, 1, 2): (5, 0, 4, 3, 1, 2),\n", + " (5, 0, 4, 3, 2, 1): (5, 0, 4, 3, 2, 1),\n", + " (5, 1, 0, 2, 3, 4): (5, 1, 0, 2, 3, 4),\n", + " (5, 1, 0, 2, 4, 3): (5, 1, 0, 2, 4, 3),\n", + " (5, 1, 0, 3, 2, 4): (5, 1, 0, 3, 2, 4),\n", + " (5, 1, 0, 3, 4, 2): (5, 1, 0, 3, 4, 2),\n", + " (5, 1, 0, 4, 2, 3): (5, 1, 0, 4, 2, 3),\n", + " (5, 1, 0, 4, 3, 2): (5, 1, 0, 4, 3, 2),\n", + " (5, 1, 2, 0, 3, 4): (5, 1, 2, 0, 3, 4),\n", + " (5, 1, 2, 0, 4, 3): (5, 1, 2, 0, 4, 3),\n", + " (5, 1, 2, 3, 0, 4): (5, 1, 2, 3, 0, 4),\n", + " (5, 1, 2, 3, 4, 0): (5, 1, 2, 3, 4, 0),\n", + " (5, 1, 2, 4, 0, 3): (5, 1, 2, 4, 0, 3),\n", + " (5, 1, 2, 4, 3, 0): (5, 1, 2, 4, 3, 0),\n", + " (5, 1, 3, 0, 2, 4): (5, 1, 3, 0, 2, 4),\n", + " (5, 1, 3, 0, 4, 2): (5, 1, 3, 0, 4, 2),\n", + " (5, 1, 3, 2, 0, 4): (5, 1, 3, 2, 0, 4),\n", + " (5, 1, 3, 2, 4, 0): (5, 1, 3, 2, 4, 0),\n", + " (5, 1, 3, 4, 0, 2): (5, 1, 3, 4, 0, 2),\n", + " (5, 1, 3, 4, 2, 0): (5, 1, 3, 4, 2, 0),\n", + " (5, 1, 4, 0, 2, 3): (5, 1, 4, 0, 2, 3),\n", + " (5, 1, 4, 0, 3, 2): (5, 1, 4, 0, 3, 2),\n", + " (5, 1, 4, 2, 0, 3): (5, 1, 4, 2, 0, 3),\n", + " (5, 1, 4, 2, 3, 0): (5, 1, 4, 2, 3, 0),\n", + " (5, 1, 4, 3, 0, 2): (5, 1, 4, 3, 0, 2),\n", + " (5, 1, 4, 3, 2, 0): (5, 1, 4, 3, 2, 0),\n", + " (5, 2, 0, 1, 3, 4): (5, 2, 0, 1, 3, 4),\n", + " (5, 2, 0, 1, 4, 3): (5, 2, 0, 1, 4, 3),\n", + " (5, 2, 0, 3, 1, 4): (5, 2, 0, 3, 1, 4),\n", + " (5, 2, 0, 3, 4, 1): (5, 2, 0, 3, 4, 1),\n", + " (5, 2, 0, 4, 1, 3): (5, 2, 0, 4, 1, 3),\n", + " (5, 2, 0, 4, 3, 1): (5, 2, 0, 4, 3, 1),\n", + " (5, 2, 1, 0, 3, 4): (5, 2, 1, 0, 3, 4),\n", + " (5, 2, 1, 0, 4, 3): (5, 2, 1, 0, 4, 3),\n", + " (5, 2, 1, 3, 0, 4): (5, 2, 1, 3, 0, 4),\n", + " (5, 2, 1, 3, 4, 0): (5, 2, 1, 3, 4, 0),\n", + " (5, 2, 1, 4, 0, 3): (5, 2, 1, 4, 0, 3),\n", + " (5, 2, 1, 4, 3, 0): (5, 2, 1, 4, 3, 0),\n", + " (5, 2, 3, 0, 1, 4): (5, 2, 3, 0, 1, 4),\n", + " (5, 2, 3, 0, 4, 1): (5, 2, 3, 0, 4, 1),\n", + " (5, 2, 3, 1, 0, 4): (5, 2, 3, 1, 0, 4),\n", + " (5, 2, 3, 1, 4, 0): (5, 2, 3, 1, 4, 0),\n", + " (5, 2, 3, 4, 0, 1): (5, 2, 3, 4, 0, 1),\n", + " (5, 2, 3, 4, 1, 0): (5, 2, 3, 4, 1, 0),\n", + " (5, 2, 4, 0, 1, 3): (5, 2, 4, 0, 1, 3),\n", + " (5, 2, 4, 0, 3, 1): (5, 2, 4, 0, 3, 1),\n", + " (5, 2, 4, 1, 0, 3): (5, 2, 4, 1, 0, 3),\n", + " (5, 2, 4, 1, 3, 0): (5, 2, 4, 1, 3, 0),\n", + " (5, 2, 4, 3, 0, 1): (5, 2, 4, 3, 0, 1),\n", + " (5, 2, 4, 3, 1, 0): (5, 2, 4, 3, 1, 0),\n", + " (5, 3, 0, 1, 2, 4): (5, 3, 0, 1, 2, 4),\n", + " (5, 3, 0, 1, 4, 2): (5, 3, 0, 1, 4, 2),\n", + " (5, 3, 0, 2, 1, 4): (5, 3, 0, 2, 1, 4),\n", + " (5, 3, 0, 2, 4, 1): (5, 3, 0, 2, 4, 1),\n", + " (5, 3, 0, 4, 1, 2): (5, 3, 0, 4, 1, 2),\n", + " (5, 3, 0, 4, 2, 1): (5, 3, 0, 4, 2, 1),\n", + " (5, 3, 1, 0, 2, 4): (5, 3, 1, 0, 2, 4),\n", + " (5, 3, 1, 0, 4, 2): (5, 3, 1, 0, 4, 2),\n", + " (5, 3, 1, 2, 0, 4): (5, 3, 1, 2, 0, 4),\n", + " (5, 3, 1, 2, 4, 0): (5, 3, 1, 2, 4, 0),\n", + " (5, 3, 1, 4, 0, 2): (5, 3, 1, 4, 0, 2),\n", + " (5, 3, 1, 4, 2, 0): (5, 3, 1, 4, 2, 0),\n", + " (5, 3, 2, 0, 1, 4): (5, 3, 2, 0, 1, 4),\n", + " (5, 3, 2, 0, 4, 1): (5, 3, 2, 0, 4, 1),\n", + " (5, 3, 2, 1, 0, 4): (5, 3, 2, 1, 0, 4),\n", + " (5, 3, 2, 1, 4, 0): (5, 3, 2, 1, 4, 0),\n", + " (5, 3, 2, 4, 0, 1): (5, 3, 2, 4, 0, 1),\n", + " (5, 3, 2, 4, 1, 0): (5, 3, 2, 4, 1, 0),\n", + " (5, 3, 4, 0, 1, 2): (5, 3, 4, 0, 1, 2),\n", + " (5, 3, 4, 0, 2, 1): (5, 3, 4, 0, 2, 1),\n", + " (5, 3, 4, 1, 0, 2): (5, 3, 4, 1, 0, 2),\n", + " (5, 3, 4, 1, 2, 0): (5, 3, 4, 1, 2, 0),\n", + " (5, 3, 4, 2, 0, 1): (5, 3, 4, 2, 0, 1),\n", + " (5, 3, 4, 2, 1, 0): (5, 3, 4, 2, 1, 0),\n", + " (5, 4, 0, 1, 2, 3): (5, 4, 0, 1, 2, 3),\n", + " (5, 4, 0, 1, 3, 2): (5, 4, 0, 1, 3, 2),\n", + " (5, 4, 0, 2, 1, 3): (5, 4, 0, 2, 1, 3),\n", + " (5, 4, 0, 2, 3, 1): (5, 4, 0, 2, 3, 1),\n", + " (5, 4, 0, 3, 1, 2): (5, 4, 0, 3, 1, 2),\n", + " (5, 4, 0, 3, 2, 1): (5, 4, 0, 3, 2, 1),\n", + " (5, 4, 1, 0, 2, 3): (5, 4, 1, 0, 2, 3),\n", + " (5, 4, 1, 0, 3, 2): (5, 4, 1, 0, 3, 2),\n", + " (5, 4, 1, 2, 0, 3): (5, 4, 1, 2, 0, 3),\n", + " (5, 4, 1, 2, 3, 0): (5, 4, 1, 2, 3, 0),\n", + " (5, 4, 1, 3, 0, 2): (5, 4, 1, 3, 0, 2),\n", + " (5, 4, 1, 3, 2, 0): (5, 4, 1, 3, 2, 0),\n", + " (5, 4, 2, 0, 1, 3): (5, 4, 2, 0, 1, 3),\n", + " (5, 4, 2, 0, 3, 1): (5, 4, 2, 0, 3, 1),\n", + " (5, 4, 2, 1, 0, 3): (5, 4, 2, 1, 0, 3),\n", + " (5, 4, 2, 1, 3, 0): (5, 4, 2, 1, 3, 0),\n", + " (5, 4, 2, 3, 0, 1): (5, 4, 2, 3, 0, 1),\n", + " (5, 4, 2, 3, 1, 0): (5, 4, 2, 3, 1, 0),\n", + " (5, 4, 3, 0, 1, 2): (5, 4, 3, 0, 1, 2),\n", + " (5, 4, 3, 0, 2, 1): (5, 4, 3, 0, 2, 1),\n", + " (5, 4, 3, 1, 0, 2): (5, 4, 3, 1, 0, 2),\n", + " (5, 4, 3, 1, 2, 0): (5, 4, 3, 1, 2, 0),\n", + " (5, 4, 3, 2, 0, 1): (5, 4, 3, 2, 0, 1),\n", + " (5, 4, 3, 2, 1, 0): (5, 4, 3, 2, 1, 0)}" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "transpositions6 = {t: t for t in set(itertools.permutations(list(range(6))))}\n", + "transpositions6" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "(((2, 4, 3, 5, 0, 1), (1, 2), ),\n", + " -1437.9908206760847)" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "key_b, score = amsco_break(c7b, translist=transpositions6)\n", + "key_b, score" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[[AmscoSlice(index=0, start=0, end=1),\n", + " AmscoSlice(index=1, start=1, end=3),\n", + " AmscoSlice(index=2, start=3, end=4),\n", + " AmscoSlice(index=3, start=4, end=6),\n", + " AmscoSlice(index=4, start=6, end=7),\n", + " AmscoSlice(index=5, start=7, end=9)],\n", + " [AmscoSlice(index=6, start=9, end=11),\n", + " AmscoSlice(index=7, start=11, end=12),\n", + " AmscoSlice(index=8, start=12, end=14),\n", + " AmscoSlice(index=9, start=14, end=15),\n", + " AmscoSlice(index=10, start=15, end=17),\n", + " AmscoSlice(index=11, start=17, end=18)],\n", + " [AmscoSlice(index=12, start=18, end=19),\n", + " AmscoSlice(index=13, start=19, end=21),\n", + " AmscoSlice(index=14, start=21, end=22),\n", + " AmscoSlice(index=15, start=22, end=24),\n", + " AmscoSlice(index=16, start=24, end=25),\n", + " AmscoSlice(index=17, start=25, end=27)],\n", + " [AmscoSlice(index=18, start=27, end=29),\n", + " AmscoSlice(index=19, start=29, end=30),\n", + " AmscoSlice(index=20, start=30, end=32),\n", + " AmscoSlice(index=21, start=32, end=33),\n", + " AmscoSlice(index=22, start=33, end=35),\n", + " AmscoSlice(index=23, start=35, end=36)],\n", + " [AmscoSlice(index=24, start=36, end=37),\n", + " AmscoSlice(index=25, start=37, end=39),\n", + " AmscoSlice(index=26, start=39, end=40),\n", + " AmscoSlice(index=27, start=40, end=42),\n", + " AmscoSlice(index=28, start=42, end=43),\n", + " AmscoSlice(index=29, start=43, end=45)],\n", + " [AmscoSlice(index=30, start=45, end=47),\n", + " AmscoSlice(index=31, start=47, end=48),\n", + " AmscoSlice(index=32, start=48, end=50),\n", + " AmscoSlice(index=33, start=50, end=51),\n", + " AmscoSlice(index=34, start=51, end=53),\n", + " AmscoSlice(index=35, start=53, end=54)],\n", + " [AmscoSlice(index=36, start=54, end=55),\n", + " AmscoSlice(index=37, start=55, end=57),\n", + " AmscoSlice(index=38, start=57, end=58),\n", + " AmscoSlice(index=39, start=58, end=60),\n", + " AmscoSlice(index=40, start=60, end=61),\n", + " AmscoSlice(index=41, start=61, end=63)],\n", + " [AmscoSlice(index=42, start=63, end=65),\n", + " AmscoSlice(index=43, start=65, end=66),\n", + " AmscoSlice(index=44, start=66, end=68),\n", + " AmscoSlice(index=45, start=68, end=69),\n", + " AmscoSlice(index=46, start=69, end=71),\n", + " AmscoSlice(index=47, start=71, end=72)],\n", + " [AmscoSlice(index=48, start=72, end=73),\n", + " AmscoSlice(index=49, start=73, end=75),\n", + " AmscoSlice(index=50, start=75, end=76),\n", + " AmscoSlice(index=51, start=76, end=78),\n", + " AmscoSlice(index=52, start=78, end=79),\n", + " AmscoSlice(index=53, start=79, end=81)],\n", + " [AmscoSlice(index=54, start=81, end=83),\n", + " AmscoSlice(index=55, start=83, end=84),\n", + " AmscoSlice(index=56, start=84, end=86),\n", + " AmscoSlice(index=57, start=86, end=87),\n", + " AmscoSlice(index=58, start=87, end=89),\n", + " AmscoSlice(index=59, start=89, end=90)],\n", + " [AmscoSlice(index=60, start=90, end=91),\n", + " AmscoSlice(index=61, start=91, end=93),\n", + " AmscoSlice(index=62, start=93, end=94),\n", + " AmscoSlice(index=63, start=94, end=96),\n", + " AmscoSlice(index=64, start=96, end=97),\n", + " AmscoSlice(index=65, start=97, end=99)],\n", + " [AmscoSlice(index=66, start=99, end=101),\n", + " AmscoSlice(index=67, start=101, end=102),\n", + " AmscoSlice(index=68, start=102, end=104),\n", + " AmscoSlice(index=69, start=104, end=105),\n", + " AmscoSlice(index=70, start=105, end=107),\n", + " AmscoSlice(index=71, start=107, end=108)],\n", + " [AmscoSlice(index=72, start=108, end=109),\n", + " AmscoSlice(index=73, start=109, end=111),\n", + " AmscoSlice(index=74, start=111, end=112),\n", + " AmscoSlice(index=75, start=112, end=114),\n", + " AmscoSlice(index=76, start=114, end=115),\n", + " AmscoSlice(index=77, start=115, end=117)],\n", + " [AmscoSlice(index=78, start=117, end=119),\n", + " AmscoSlice(index=79, start=119, end=120),\n", + " AmscoSlice(index=80, start=120, end=122),\n", + " AmscoSlice(index=81, start=122, end=123),\n", + " AmscoSlice(index=82, start=123, end=125),\n", + " AmscoSlice(index=83, start=125, end=126)],\n", + " [AmscoSlice(index=84, start=126, end=127),\n", + " AmscoSlice(index=85, start=127, end=129),\n", + " AmscoSlice(index=86, start=129, end=130),\n", + " AmscoSlice(index=87, start=130, end=132),\n", + " AmscoSlice(index=88, start=132, end=133),\n", + " AmscoSlice(index=89, start=133, end=135)],\n", + " [AmscoSlice(index=90, start=135, end=137),\n", + " AmscoSlice(index=91, start=137, end=138),\n", + " AmscoSlice(index=92, start=138, end=140),\n", + " AmscoSlice(index=93, start=140, end=141),\n", + " AmscoSlice(index=94, start=141, end=143),\n", + " AmscoSlice(index=95, start=143, end=144)],\n", + " [AmscoSlice(index=96, start=144, end=145),\n", + " AmscoSlice(index=97, start=145, end=147),\n", + " AmscoSlice(index=98, start=147, end=148),\n", + " AmscoSlice(index=99, start=148, end=150),\n", + " AmscoSlice(index=100, start=150, end=151),\n", + " AmscoSlice(index=101, start=151, end=153)],\n", + " [AmscoSlice(index=102, start=153, end=155),\n", + " AmscoSlice(index=103, start=155, end=156),\n", + " AmscoSlice(index=104, start=156, end=158),\n", + " AmscoSlice(index=105, start=158, end=159),\n", + " AmscoSlice(index=106, start=159, end=161),\n", + " AmscoSlice(index=107, start=161, end=162)],\n", + " [AmscoSlice(index=108, start=162, end=163),\n", + " AmscoSlice(index=109, start=163, end=165),\n", + " AmscoSlice(index=110, start=165, end=166),\n", + " AmscoSlice(index=111, start=166, end=168),\n", + " AmscoSlice(index=112, start=168, end=169),\n", + " AmscoSlice(index=113, start=169, end=171)],\n", + " [AmscoSlice(index=114, start=171, end=173),\n", + " AmscoSlice(index=115, start=173, end=174),\n", + " AmscoSlice(index=116, start=174, end=176),\n", + " AmscoSlice(index=117, start=176, end=177),\n", + " AmscoSlice(index=118, start=177, end=179),\n", + " AmscoSlice(index=119, start=179, end=180)],\n", + " [AmscoSlice(index=120, start=180, end=181),\n", + " AmscoSlice(index=121, start=181, end=183),\n", + " AmscoSlice(index=122, start=183, end=184),\n", + " AmscoSlice(index=123, start=184, end=186),\n", + " AmscoSlice(index=124, start=186, end=187),\n", + " AmscoSlice(index=125, start=187, end=189)],\n", + " [AmscoSlice(index=126, start=189, end=191),\n", + " AmscoSlice(index=127, start=191, end=192),\n", + " AmscoSlice(index=128, start=192, end=194),\n", + " AmscoSlice(index=129, start=194, end=195),\n", + " AmscoSlice(index=130, start=195, end=197),\n", + " AmscoSlice(index=131, start=197, end=198)],\n", + " [AmscoSlice(index=132, start=198, end=199),\n", + " AmscoSlice(index=133, start=199, end=201),\n", + " AmscoSlice(index=134, start=201, end=202),\n", + " AmscoSlice(index=135, start=202, end=204),\n", + " AmscoSlice(index=136, start=204, end=205),\n", + " AmscoSlice(index=137, start=205, end=207)],\n", + " [AmscoSlice(index=138, start=207, end=209),\n", + " AmscoSlice(index=139, start=209, end=210),\n", + " AmscoSlice(index=140, start=210, end=212),\n", + " AmscoSlice(index=141, start=212, end=213),\n", + " AmscoSlice(index=142, start=213, end=215),\n", + " AmscoSlice(index=143, start=215, end=216)],\n", + " [AmscoSlice(index=144, start=216, end=217),\n", + " AmscoSlice(index=145, start=217, end=219),\n", + " AmscoSlice(index=146, start=219, end=220),\n", + " AmscoSlice(index=147, start=220, end=222),\n", + " AmscoSlice(index=148, start=222, end=223),\n", + " AmscoSlice(index=149, start=223, end=225)],\n", + " [AmscoSlice(index=150, start=225, end=227),\n", + " AmscoSlice(index=151, start=227, end=228),\n", + " AmscoSlice(index=152, start=228, end=230),\n", + " AmscoSlice(index=153, start=230, end=231),\n", + " AmscoSlice(index=154, start=231, end=233),\n", + " AmscoSlice(index=155, start=233, end=234)],\n", + " [AmscoSlice(index=156, start=234, end=235),\n", + " AmscoSlice(index=157, start=235, end=237),\n", + " AmscoSlice(index=158, start=237, end=238),\n", + " AmscoSlice(index=159, start=238, end=240),\n", + " AmscoSlice(index=160, start=240, end=241),\n", + " AmscoSlice(index=161, start=241, end=243)],\n", + " [AmscoSlice(index=162, start=243, end=245),\n", + " AmscoSlice(index=163, start=245, end=246),\n", + " AmscoSlice(index=164, start=246, end=248),\n", + " AmscoSlice(index=165, start=248, end=249),\n", + " AmscoSlice(index=166, start=249, end=251),\n", + " AmscoSlice(index=167, start=251, end=252)],\n", + " [AmscoSlice(index=168, start=252, end=253),\n", + " AmscoSlice(index=169, start=253, end=255),\n", + " AmscoSlice(index=170, start=255, end=256),\n", + " AmscoSlice(index=171, start=256, end=258),\n", + " AmscoSlice(index=172, start=258, end=259),\n", + " AmscoSlice(index=173, start=259, end=261)],\n", + " [AmscoSlice(index=174, start=261, end=263),\n", + " AmscoSlice(index=175, start=263, end=264),\n", + " AmscoSlice(index=176, start=264, end=266),\n", + " AmscoSlice(index=177, start=266, end=267),\n", + " AmscoSlice(index=178, start=267, end=269),\n", + " AmscoSlice(index=179, start=269, end=270)],\n", + " [AmscoSlice(index=180, start=270, end=271),\n", + " AmscoSlice(index=181, start=271, end=273),\n", + " AmscoSlice(index=182, start=273, end=274),\n", + " AmscoSlice(index=183, start=274, end=276),\n", + " AmscoSlice(index=184, start=276, end=277),\n", + " AmscoSlice(index=185, start=277, end=279)],\n", + " [AmscoSlice(index=186, start=279, end=281),\n", + " AmscoSlice(index=187, start=281, end=282),\n", + " AmscoSlice(index=188, start=282, end=284),\n", + " AmscoSlice(index=189, start=284, end=285),\n", + " AmscoSlice(index=190, start=285, end=287),\n", + " AmscoSlice(index=191, start=287, end=288)],\n", + " [AmscoSlice(index=192, start=288, end=289),\n", + " AmscoSlice(index=193, start=289, end=291),\n", + " AmscoSlice(index=194, start=291, end=292),\n", + " AmscoSlice(index=195, start=292, end=294),\n", + " AmscoSlice(index=196, start=294, end=295),\n", + " AmscoSlice(index=197, start=295, end=297)],\n", + " [AmscoSlice(index=198, start=297, end=299),\n", + " AmscoSlice(index=199, start=299, end=300),\n", + " AmscoSlice(index=200, start=300, end=302),\n", + " AmscoSlice(index=201, start=302, end=303),\n", + " AmscoSlice(index=202, start=303, end=305),\n", + " AmscoSlice(index=203, start=305, end=306)],\n", + " [AmscoSlice(index=204, start=306, end=307),\n", + " AmscoSlice(index=205, start=307, end=309),\n", + " AmscoSlice(index=206, start=309, end=310),\n", + " AmscoSlice(index=207, start=310, end=312),\n", + " AmscoSlice(index=208, start=312, end=313),\n", + " AmscoSlice(index=209, start=313, end=315)],\n", + " [AmscoSlice(index=210, start=315, end=317),\n", + " AmscoSlice(index=211, start=317, end=318),\n", + " AmscoSlice(index=212, start=318, end=320),\n", + " AmscoSlice(index=213, start=320, end=321),\n", + " AmscoSlice(index=214, start=321, end=323),\n", + " AmscoSlice(index=215, start=323, end=324)],\n", + " [AmscoSlice(index=216, start=324, end=325),\n", + " AmscoSlice(index=217, start=325, end=327),\n", + " AmscoSlice(index=218, start=327, end=328),\n", + " AmscoSlice(index=219, start=328, end=330),\n", + " AmscoSlice(index=220, start=330, end=331),\n", + " AmscoSlice(index=221, start=331, end=333)],\n", + " [AmscoSlice(index=222, start=333, end=335),\n", + " AmscoSlice(index=223, start=335, end=336),\n", + " AmscoSlice(index=224, start=336, end=338),\n", + " AmscoSlice(index=225, start=338, end=339),\n", + " AmscoSlice(index=226, start=339, end=341),\n", + " AmscoSlice(index=227, start=341, end=342)],\n", + " [AmscoSlice(index=228, start=342, end=343),\n", + " AmscoSlice(index=229, start=343, end=345),\n", + " AmscoSlice(index=230, start=345, end=346),\n", + " AmscoSlice(index=231, start=346, end=348),\n", + " AmscoSlice(index=232, start=348, end=349),\n", + " AmscoSlice(index=233, start=349, end=351)],\n", + " [AmscoSlice(index=234, start=351, end=353),\n", + " AmscoSlice(index=235, start=353, end=354),\n", + " AmscoSlice(index=236, start=354, end=356),\n", + " AmscoSlice(index=237, start=356, end=357),\n", + " AmscoSlice(index=238, start=357, end=359),\n", + " AmscoSlice(index=239, start=359, end=360)],\n", + " [AmscoSlice(index=240, start=360, end=361),\n", + " AmscoSlice(index=241, start=361, end=363),\n", + " AmscoSlice(index=242, start=363, end=364),\n", + " AmscoSlice(index=243, start=364, end=366),\n", + " AmscoSlice(index=244, start=366, end=367),\n", + " AmscoSlice(index=245, start=367, end=369)],\n", + " [AmscoSlice(index=246, start=369, end=371),\n", + " AmscoSlice(index=247, start=371, end=372),\n", + " AmscoSlice(index=248, start=372, end=374),\n", + " AmscoSlice(index=249, start=374, end=375),\n", + " AmscoSlice(index=250, start=375, end=377),\n", + " AmscoSlice(index=251, start=377, end=378)],\n", + " [AmscoSlice(index=252, start=378, end=379),\n", + " AmscoSlice(index=253, start=379, end=381),\n", + " AmscoSlice(index=254, start=381, end=382),\n", + " AmscoSlice(index=255, start=382, end=384),\n", + " AmscoSlice(index=256, start=384, end=385),\n", + " AmscoSlice(index=257, start=385, end=387)],\n", + " [AmscoSlice(index=258, start=387, end=389),\n", + " AmscoSlice(index=259, start=389, end=390),\n", + " AmscoSlice(index=260, start=390, end=392),\n", + " AmscoSlice(index=261, start=392, end=393),\n", + " AmscoSlice(index=262, start=393, end=395),\n", + " AmscoSlice(index=263, start=395, end=396)],\n", + " [AmscoSlice(index=264, start=396, end=397),\n", + " AmscoSlice(index=265, start=397, end=399),\n", + " AmscoSlice(index=266, start=399, end=400),\n", + " AmscoSlice(index=267, start=400, end=402),\n", + " AmscoSlice(index=268, start=402, end=403),\n", + " AmscoSlice(index=269, start=403, end=405)],\n", + " [AmscoSlice(index=270, start=405, end=407),\n", + " AmscoSlice(index=271, start=407, end=408),\n", + " AmscoSlice(index=272, start=408, end=410),\n", + " AmscoSlice(index=273, start=410, end=411),\n", + " AmscoSlice(index=274, start=411, end=413),\n", + " AmscoSlice(index=275, start=413, end=414)],\n", + " [AmscoSlice(index=276, start=414, end=415),\n", + " AmscoSlice(index=277, start=415, end=417),\n", + " AmscoSlice(index=278, start=417, end=418),\n", + " AmscoSlice(index=279, start=418, end=420),\n", + " AmscoSlice(index=280, start=420, end=421),\n", + " AmscoSlice(index=281, start=421, end=423)],\n", + " [AmscoSlice(index=282, start=423, end=425),\n", + " AmscoSlice(index=283, start=425, end=426),\n", + " AmscoSlice(index=284, start=426, end=428),\n", + " AmscoSlice(index=285, start=428, end=429),\n", + " AmscoSlice(index=286, start=429, end=431),\n", + " AmscoSlice(index=287, start=431, end=432)],\n", + " [AmscoSlice(index=288, start=432, end=433),\n", + " AmscoSlice(index=289, start=433, end=435),\n", + " AmscoSlice(index=290, start=435, end=436),\n", + " AmscoSlice(index=291, start=436, end=438),\n", + " AmscoSlice(index=292, start=438, end=439),\n", + " AmscoSlice(index=293, start=439, end=441)],\n", + " [AmscoSlice(index=294, start=441, end=443),\n", + " AmscoSlice(index=295, start=443, end=444),\n", + " AmscoSlice(index=296, start=444, end=446),\n", + " AmscoSlice(index=297, start=446, end=447),\n", + " AmscoSlice(index=298, start=447, end=449),\n", + " AmscoSlice(index=299, start=449, end=450)],\n", + " [AmscoSlice(index=300, start=450, end=451),\n", + " AmscoSlice(index=301, start=451, end=453),\n", + " AmscoSlice(index=302, start=453, end=454),\n", + " AmscoSlice(index=303, start=454, end=456),\n", + " AmscoSlice(index=304, start=456, end=457),\n", + " AmscoSlice(index=305, start=457, end=459)],\n", + " [AmscoSlice(index=306, start=459, end=461),\n", + " AmscoSlice(index=307, start=461, end=462),\n", + " AmscoSlice(index=308, start=462, end=464),\n", + " AmscoSlice(index=309, start=464, end=465),\n", + " AmscoSlice(index=310, start=465, end=467),\n", + " AmscoSlice(index=311, start=467, end=468)],\n", + " [AmscoSlice(index=312, start=468, end=469),\n", + " AmscoSlice(index=313, start=469, end=471),\n", + " AmscoSlice(index=314, start=471, end=472),\n", + " AmscoSlice(index=315, start=472, end=474),\n", + " AmscoSlice(index=316, start=474, end=475),\n", + " AmscoSlice(index=317, start=475, end=477)],\n", + " [AmscoSlice(index=318, start=477, end=479),\n", + " AmscoSlice(index=319, start=479, end=480),\n", + " AmscoSlice(index=320, start=480, end=482),\n", + " AmscoSlice(index=321, start=482, end=483),\n", + " AmscoSlice(index=322, start=483, end=485),\n", + " AmscoSlice(index=323, start=485, end=486)],\n", + " [AmscoSlice(index=324, start=486, end=487),\n", + " AmscoSlice(index=325, start=487, end=489),\n", + " AmscoSlice(index=326, start=489, end=490),\n", + " AmscoSlice(index=327, start=490, end=492),\n", + " AmscoSlice(index=328, start=492, end=493),\n", + " AmscoSlice(index=329, start=493, end=495)],\n", + " [AmscoSlice(index=330, start=495, end=497),\n", + " AmscoSlice(index=331, start=497, end=498),\n", + " AmscoSlice(index=332, start=498, end=500),\n", + " AmscoSlice(index=333, start=500, end=501),\n", + " AmscoSlice(index=334, start=501, end=503),\n", + " AmscoSlice(index=335, start=503, end=504)],\n", + " [AmscoSlice(index=336, start=504, end=505),\n", + " AmscoSlice(index=337, start=505, end=507),\n", + " AmscoSlice(index=338, start=507, end=508),\n", + " AmscoSlice(index=339, start=508, end=510),\n", + " AmscoSlice(index=340, start=510, end=511),\n", + " AmscoSlice(index=341, start=511, end=513)],\n", + " [AmscoSlice(index=342, start=513, end=515),\n", + " AmscoSlice(index=343, start=515, end=516),\n", + " AmscoSlice(index=344, start=516, end=518),\n", + " AmscoSlice(index=345, start=518, end=519),\n", + " AmscoSlice(index=346, start=519, end=521),\n", + " AmscoSlice(index=347, start=521, end=522)],\n", + " [AmscoSlice(index=348, start=522, end=523),\n", + " AmscoSlice(index=349, start=523, end=525),\n", + " AmscoSlice(index=350, start=525, end=526),\n", + " AmscoSlice(index=351, start=526, end=528),\n", + " AmscoSlice(index=352, start=528, end=529),\n", + " AmscoSlice(index=353, start=529, end=531)],\n", + " [AmscoSlice(index=354, start=531, end=533),\n", + " AmscoSlice(index=355, start=533, end=534),\n", + " AmscoSlice(index=356, start=534, end=536),\n", + " AmscoSlice(index=357, start=536, end=537),\n", + " AmscoSlice(index=358, start=537, end=539),\n", + " AmscoSlice(index=359, start=539, end=540)],\n", + " [AmscoSlice(index=360, start=540, end=541),\n", + " AmscoSlice(index=361, start=541, end=543),\n", + " AmscoSlice(index=362, start=543, end=544),\n", + " AmscoSlice(index=363, start=544, end=546),\n", + " AmscoSlice(index=364, start=546, end=547),\n", + " AmscoSlice(index=365, start=547, end=549)],\n", + " [AmscoSlice(index=366, start=549, end=551),\n", + " AmscoSlice(index=367, start=551, end=552),\n", + " AmscoSlice(index=368, start=552, end=554),\n", + " AmscoSlice(index=369, start=554, end=555),\n", + " AmscoSlice(index=370, start=555, end=557),\n", + " AmscoSlice(index=371, start=557, end=558)],\n", + " [AmscoSlice(index=372, start=558, end=559),\n", + " AmscoSlice(index=373, start=559, end=561),\n", + " AmscoSlice(index=374, start=561, end=562),\n", + " AmscoSlice(index=375, start=562, end=564),\n", + " AmscoSlice(index=376, start=564, end=565),\n", + " AmscoSlice(index=377, start=565, end=567)],\n", + " [AmscoSlice(index=378, start=567, end=569),\n", + " AmscoSlice(index=379, start=569, end=570),\n", + " AmscoSlice(index=380, start=570, end=572),\n", + " AmscoSlice(index=381, start=572, end=573),\n", + " AmscoSlice(index=382, start=573, end=575),\n", + " AmscoSlice(index=383, start=575, end=576)],\n", + " [AmscoSlice(index=384, start=576, end=577),\n", + " AmscoSlice(index=385, start=577, end=579),\n", + " AmscoSlice(index=386, start=579, end=580),\n", + " AmscoSlice(index=387, start=580, end=582),\n", + " AmscoSlice(index=388, start=582, end=583),\n", + " AmscoSlice(index=389, start=583, end=585)],\n", + " [AmscoSlice(index=390, start=585, end=587),\n", + " AmscoSlice(index=391, start=587, end=588),\n", + " AmscoSlice(index=392, start=588, end=590),\n", + " AmscoSlice(index=393, start=590, end=591),\n", + " AmscoSlice(index=394, start=591, end=593),\n", + " AmscoSlice(index=395, start=593, end=594)],\n", + " [AmscoSlice(index=396, start=594, end=595),\n", + " AmscoSlice(index=397, start=595, end=597),\n", + " AmscoSlice(index=398, start=597, end=598),\n", + " AmscoSlice(index=399, start=598, end=600),\n", + " AmscoSlice(index=400, start=600, end=601),\n", + " AmscoSlice(index=401, start=601, end=603)],\n", + " [AmscoSlice(index=402, start=603, end=605),\n", + " AmscoSlice(index=403, start=605, end=606),\n", + " AmscoSlice(index=404, start=606, end=608),\n", + " AmscoSlice(index=405, start=608, end=609),\n", + " AmscoSlice(index=406, start=609, end=611),\n", + " AmscoSlice(index=407, start=611, end=612)]]" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "amsco_transposition_positions(c7b, 'abcdef', \n", + " fillpattern=(1, 2),\n", + " fillstyle=AmscoFillStyle.reverse_each_row)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "['stager',\n", + " 'staler',\n", + " 'stalin',\n", + " 'stamen',\n", + " 'sucker',\n", + " 'tucker',\n", + " 'twangs',\n", + " 'twerps',\n", + " 'twirls',\n", + " 'staffer',\n", + " 'stagers',\n", + " 'stagger',\n", + " 'stalins',\n", + " 'stamens',\n", + " 'stamina',\n", + " 'stammer',\n", + " 'statler',\n", + " 'suckers',\n", + " 'sudsier',\n", + " 'swagger',\n", + " 'tubbier',\n", + " 'tycoons',\n", + " 'loadable',\n", + " 'noblemen',\n", + " 'rubidium',\n", + " 'staffers',\n", + " 'staggers',\n", + " 'staminas',\n", + " 'stammers',\n", + " 'standard',\n", + " 'steelier',\n", + " 'submerse',\n", + " 'swaggers',\n", + " 'tubbiest',\n", + " 'tuitions',\n", + " 'twenties',\n", + " 'stalemate',\n", + " 'staleness',\n", + " 'stalinist',\n", + " 'stammerer',\n", + " 'standards',\n", + " 'submerses',\n", + " 'swaggerer',\n", + " 'stalemates',\n", + " 'stalenesss',\n", + " 'stammerers',\n", + " 'stepsister',\n", + " 'succulence',\n", + " 'statistical',\n", + " 'stepsisters',\n", + " 'succulences',\n", + " 'statistician',\n", + " 'statisticians']" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "transpositions[key_b[0]]" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "security protocol solitaire comrades under a decree from moscow we are confined to using a new high security stream cipher stolen from the americans the solitaire cipher all files classified top secret and above are to be archived using this method this new field cipher has been tested and proven to match the security of the fi alka machine without the overhead of the technology you will need only a deck of cards to implement the cipher the key to be used will be provided and distributed on a one time pad and you must destroy the key as you use it the key consists of a random shuffle of a full deck of cards together with two distinguishable jokers agents should be freely able to carry this equipment without arousing suspicion\n" + ] + } + ], + "source": [ + "print(' '.join(segment(sanitise(\n", + " amsco_transposition_decipher(sanitise(c7b), \n", + " keyword=transpositions[key_b[0]][0], \n", + " fillpattern=key_b[1],\n", + " fillstyle=key_b[2])\n", + " ))))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.4.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/2015/7a.ciphertext b/2015/7a.ciphertext new file mode 100644 index 0000000..3df8fa8 --- /dev/null +++ b/2015/7a.ciphertext @@ -0,0 +1 @@ +RTBFX UIUHT UZWUW ZAMMT BHUGS AUZSA ZEJHU ZIILH ARTIR WBNIM HTUZS GEINA FIUFI CAFHM IYBPT BKIBZ ACCAF HJZUH PTIFI URTIR WILHT IRUCT IFRXI FWGEB RWSFA JZLBZ LUHHJ FZGAJ HGTIU GMTUH IFJGG UBZTI FNBYU XPXIN HYAGR AMUZE JHGTI TBGFI XBHUK IGUZH TISJX BSBHC IFYGT IRXIB FXPTB GZAXA KINAF HTIGA KUIHS AKIFZ YIZHG AUBYG HUXXZ AHGJF IMTAG TIMBG MAFWU ZSNAF EJHUH TUZWH TUGUG WIPUZ HIXXU SIZRI UZHTI YIBZH UYIUT BKIEI IZMBH RTUZS HTIEF UHGHT IPGII YHATB KIEII ZUZRA ZHBRH MUHTA JFNFU IZLGU ZHTIF IURTG LAWHA FBZLH TIPUZ HJFZT BKIEI IZMBH RTUZS HTINF IZRTU HGIIY GXUWI MIBFI BXXMA FWUZS BSBUZ GHAZI BZAHT IFMTU RTUFI BXXPL ULZHI OCIRH BZLSU KIZMT BHMIF IBLUZ HTINF IZRTL ARJYI ZHXBG HMIIW ULAZH HTUZW HTBHU GBRAU ZRULI ZRIYP AMZSJ IGGUG HTBHH TIFJG GUBZG WZAMM TBHUG SAUZS AZBZL HTBHA JFEIG HTACI ANJZR AKIFU ZSUHU GHAEF IBWUZ HAHTI UFTDB ZLHFP HANUZ LGAYI HTUZS HTIFI JZNAF HJZBH IXPBR RAFLU ZSHAY PGAJF RIPJF UHTIP TBKIH BWIZH AJGUZ SBZIM RUCTI FGAXU HBUFI NAFBF RTUKI GHAFB SIANH ACGIR FIHNU XIGGA IKIZU NMIYB ZBSIH AGHIB XHTIF IXIKB ZHNUX IUHMU XXHBW IBXAH ANRAY CJHUZ SHAEF IBWHT IRUCT IFUBH HBRTB EFUIN YIGGB SINFA YPJFU IZRFP CHILJ GUZSB ZBYGR ARUCT IFWIP MAFLX IZSHT UGGUO UZMTU RTTIL IGRFU EIGHT IRUCT IFUHU GKIFP RXIKI FGUYC XIHAU YCXIY IZHEJ HBLIK UXHAR FBRWB ZLYPA ZITAC IUGHT BHMIR BZBXG ANUZL HTIRU CTIFW IPMTU XIUZH TITDA FBHXI BGHCB FHANU HUCXB ZHAIZ HIFUZ HMAMI IWGAZ LIRIY EIFGU OHIIZ HTHTI FJGGU BZGBF ITAGH UZSBX BFSIC FACBS BZLBI KIZHB GCBFH ANHTI UZHIF ZBHUA ZBXIE BJBJG GHIXX JZSMU HTXIB LUZSC AXUHE JFAYI YEIFG UZBHH IZLBZ RIYAG HANHT IGIRJ FUHPH IBYMU XXEIA RRJCU ILMUH THTBH BZLTD GIRJF UHPMU XXEIF IXBHU KIXPX USTHM UHTXJ RWUMU XXSIH UZBZL AJHMU HTHTI NUXIG MIZII LHTBH ZUSTH BZLHT IZMIR BZSIH HAHTI EAHHA YANHT IMTAX IFIUR TGLAW HAFGH FBHBS IYBXX HTIEI GHTBF FP diff --git a/2015/7b.ciphertext b/2015/7b.ciphertext new file mode 100644 index 0000000..fa2cf28 --- /dev/null +++ b/2015/7b.ciphertext @@ -0,0 +1 @@ +UOCAD EDMMA EDAEC RRSOI COIPI IFEBO BDUSI SDSBE ENTTY ANETA DCOUD KOOTT RBELE DRAOA USYYO HISNL EDDSR ISHRS HEEOS ETROS TLSEU NRSCC OUWRI MOLHN STERS EDEEA RINTE WPENN OMSFT AITOF TOILL CAPEC ESEPN DUETN DEEUS ESOMF AKOGT INLGE LYARU ITSIC RIOIR SECOR ETNEU EATMT ALIHL EICRV EASME NCIED ATHEO LKWHE OHNWO NFIMH THUBE AIBND ATTHU EKTDO OECTW ITABA OULCA QWIUP IYPOC ODEEO ONSHI TCIEE ATAIA CLTTA RCHGH OFHET DPAEC HMAHV EHLOL YARLE IKEDR ODTEI DYSKE EYCFS HFOFE HTGEJ NDBBR YPHON IOSRO LMREF RWFII GHYPH NMEHR ELASO NDEIV TDTIR HEROT URECH ORHEG YNDED MEPYT WVIID OMOUT YAION AUFUC ATWOU OKTEF LTHMU TGNEC TITAR AOWEN NGSST EFRRE SCLFS PSATO EHIHE LASTV CHIFI IUTET EYEEC STNHE OILDS TNEPM ROSTT SRAFL LRHED ISESS RETIE NASU diff --git a/SIGNED.md b/SIGNED.md index 250650b..00e585e 100644 --- a/SIGNED.md +++ b/SIGNED.md @@ -3,19 +3,19 @@ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 -iQIcBAABCAAGBQJWWJa0AAoJEJPB2e07PgbqOFkP/jmfCjzYoLGLAcbfUNDTl+kB -5M81aiy73fMNJV2+GoGBflZpJ1Br0/yi+kSMFmK2Vv68jpHNuGaL+ihncVhE2TbE -2LvhwbFYGugkKNBYt8nDDb2VMMKoaTU9xqpPxYTI1FAIKTDVCimZw3BurzJsd8P1 -Ow9OEA6LwzP2wJksOj+W+f0i4eATPbq8S3/1uoccgoWLmMgwq2GenDKqZIYs1H0a -PFPld3Q/WC5BsMt7+Cn4JPQfe+IlfKrfWKTCx0ycs2zONWljvxrNf16qt9681sDm -FKMsBGjB5yfvUAXs1iMhxWrXFY+dZlBkMeQmyDy/4BGzJMu3XlJOcMG0JaDCaeHW -+JTUIl7cRMj/DsKbZO4ENFIHe8RL5rrgW1gVOlhT3WJVY9WAi57PDnAvo1CQTjXe -3w7/KVu5YU7YiAZnF6p1W3DU1N0VyD7zTWgltj0r85CWAalJgqzat1Uyku5MWLbA -KGof90lYreYrhFbQ8lLepKEI2c5MyBkrW4CO6/IPJlRAT2qQNLZBRNbz3FQK8bWz -QOg7LeRtrBaKDAFaOV2tkfCS41XxipEVlSlHCS4R0M7Lwl91FWKQ9+60cAVUcUEJ -NPyCUseKkemvEYp6I3NKjEzB2VNJbaobEWXMff33xvoZqc46+oCyrLsvutdr/Zwj -8fTRls78YF61wxgZsLa0 -=++sq +iQIcBAABCAAGBQJWjWDiAAoJEJPB2e07PgbqTQYP/1p/mIWKco0sY82X/5qVzeED +BC90G90sl0hijCLVIWOJX1lQNAjShUDFb/jw9EXP1eZBInfSrkXVwTX6WkoXzkyz +FOc4D1EN2IsSsvcI9HMMyxsu4Bnrj24/r0vbLoiNt2KCiEosN5h/ZQR43ZTcVwjB +HLe8izsuBLjhkOi2bSOGGRKDRn52figwO9x2+fCGFpWskJR2BWL2tJM6wp4OihVF +hqAhY7VdTOPM51dc4xVvP09kJf/jhaTILPi6WJhO09PwURPyfZ5dZr3te0IxLwmL +IxBOx9aLDSbfoYeWhpNqIEpXyu626hYESppLnIcTItlLxf7EqXnRJquw8ipbeFae +MAd26KcRl4/ox4isXBPPJo70MtsrDlg8Sdq5o4iWu2gAyVR9OMRtyPMpcFWYwFc3 +9LQY/BSxFUcFF7ROHQwvNy+4AlaaGvADgywY1TU3M/7wwPFfSxQIvJeSt/PCSqRU +rIU8dQE4n3LyNPY3xnoWx/pSbz6EiZ4Lpq+E8N0GzORF7WgYdZaCLd2p3SAT/fCy +u8Xw3R3+Wvn7L+tQFpMRrTnQBbtqVyec1wqmvevIeSRQBV5ukbmdRaeAhlROVsAp +yrDLbwMIv2JqQMz+5EzpeE9Nj3pwwiTNLi1e+65werspyTIPSIEd2XqO3WXO816U +hJywA30EPavQXyfxxRrx +=6EPA -----END PGP SIGNATURE----- ``` @@ -125,12 +125,15 @@ size exec file contents 840 5b.ciphertext 69f3e64a2fa925a84f1f0b09b30bf901564436519f1c8b515121219fcd544638 2114 6a.ciphertext 64834f6db2055a3c1944d0c22e635fc411cb210ca71a7d737008f42de4febab9 867 6b.ciphertext abc25188099a927323379ff6e3abad85312aca3cd01338848437c654f6ee5f72 +1779 7a.ciphertext e519e7120bc68dc433723b1408a5b50780ce15413dae6af3e6874e2b44993dfc +725 7b.ciphertext 9376b3432de0b238d17704cee5ebc029142018233339161c64b3f6ade9b7df04 3620 2015-challenge1.ipynb 2ab544f48c22a3a2e665b03ae094ac2de04aee8bdb37366209276a937d248d6a 4092 2015-challenge2.ipynb 58c2aeca6c73a8fef71d0cc8321469358803f392c02fd44631dd0b25c2755f4a 3987 2015-challenge3.ipynb dfec26ba881c7ad0af54d072aeba4d08162661e863266936963130548ff86b65 8030 2015-challenge4.ipynb f77ead0eae7fcd67039d500a31ad1748a4df115905adecd0e93e56f72bbdcfa0 5039 2015-challenge5.ipynb b0c28829c329d7a2752f4991006e6d78a10415d7609b893b80b3bdb788d6e533 14079 2015-challenge6.ipynb 7bd1dcff4b764d75e002622ce6a4cc3c00625aa311ef886e5a436822660c565c +76275 2015-challenge7.ipynb c48d71ef5c105dff987981c05ce4a9d2cce382e6d54358d7e2a3b6fe9fc74f10 18025 LICENSE a01259a1b522cf0de95824f9860613b453153eebac468e96196d5d7dba84786c 7999 LJ!-Qt!-Fghxft-dferts%3B-hsjeukaxxn-sfedw.ipynb 429b6c6995096ff19c28a5ee342bef8ea4774200bdf9aaf6268de3cb8b28df28 61 README.md 277247b410300ee16477b12ca54ad878d81c8061f6134e2e1cadccaf299de3a3 @@ -138,8 +141,9 @@ size exec file contents 6488666 big.txt fa066c7d40f0f201ac4144e652aa62430e58a6b3805ec70650f678da5804e87b 16832 cadenus-ciphers.ipynb 50e49b3ec5e6440b86fe13472b9f4ab9e133e5665c7280b2abf7a6b57bb8a89a 514 caesar_break_parameter_trials.csv 6586223bcc00e06e3ff79d107202d6c29ef962a6dd544add00610c5907407e85|1cb7cc77831ef3ef4f994a9ea77e82a841b38acdde45ede9cedbe7a54f1e8e46 -41380 cipher.py 39536843924325b9acdc6aad387c55240fc12a9c23caeaee6ef67e0d7b94e95c -28349 cipherbreak.py 2a4cdf810302d5645064e460a4409f32173b02fc4e7c7ce0a84d1458a04007bc +318 cipher-training.sublime-project 58e5d5b4e54fb29abecaef2d41266e3355adccb8b6a70bd595e509bd07c16587 +42052 cipher.py 4ae3835f58782e76f8dc747ce46ae461c11236cf3397ee32adec8e974cf06153 +28736 cipherbreak.py cbda3e76773ad3125e00360622d1e01eccf376d4e783617c925cc4c557e97d86 11564 count_1edit.txt 3bf563ef032ba151ec1a4b2d1f33f50c49f4a47e4dc5b8152394bc5b63f57655|b5fbacbebcc25f5011ce97bc9ac967a09c50eef28b4aa98379a6c426df6ac08b 223 count_1l.txt 335388d457db6ef1da05d8b55ab879e9be7d4e021085efc8d9dfeac0e4a79aa9 4956241 count_1w.txt 51df159fd3de12b20e403c108f526e96dbd723d9cabdd5f17955cdc16059e690 diff --git a/cipher-training.sublime-project b/cipher-training.sublime-project new file mode 100644 index 0000000..23662f1 --- /dev/null +++ b/cipher-training.sublime-project @@ -0,0 +1,23 @@ +{ + "folders": + [ + { "file_exclude_patterns": + [ + "*.png", + "*.jpg", + "*.ipynb" + ], + "folder_exclude_patterns": + [ + "*.ipynb_checkpoints", + "__pycache__" + ], + "follow_symlinks": true, + "path": "/home/neil/Documents/programming/cipher-training" + } + ], + "settings": + { + "tab_size": 4 + } +} diff --git a/cipher.py b/cipher.py index 83700a5..eb0a169 100644 --- a/cipher.py +++ b/cipher.py @@ -763,8 +763,14 @@ def hill_decipher(matrix, message, fillvalue='a'): # from 'start' to 'end' AmscoSlice = collections.namedtuple('AmscoSlice', ['index', 'start', 'end']) +class AmscoFillStyle(Enum): + continuous = 1 + same_each_row = 2 + reverse_each_row = 3 + def amsco_transposition_positions(message, keyword, fillpattern=(1, 2), + fillstyle=AmscoFillStyle.continuous, fillcolumnwise=False, emptycolumnwise=True): """Creates the grid for the AMSCO transposition cipher. Each element in the @@ -801,17 +807,25 @@ def amsco_transposition_positions(message, keyword, current_position = 0 grid = [] + current_fillpattern = fillpattern while current_position < message_length: row = [] + if fillstyle == AmscoFillStyle.same_each_row: + fill_iterator = cycle(fillpattern) + if fillstyle == AmscoFillStyle.reverse_each_row: + fill_iterator = cycle(current_fillpattern) for _ in range(len(transpositions)): index = next(indices) gap = next(fill_iterator) row += [AmscoSlice(index, current_position, current_position + gap)] current_position += gap grid += [row] + if fillstyle == AmscoFillStyle.reverse_each_row: + current_fillpattern = list(reversed(current_fillpattern)) return [transpose(r, transpositions) for r in grid] -def amsco_transposition_encipher(message, keyword, fillpattern=(1,2)): +def amsco_transposition_encipher(message, keyword, + fillpattern=(1,2), fillstyle=AmscoFillStyle.reverse_each_row): """AMSCO transposition encipher. >>> amsco_transposition_encipher('hellothere', 'abc', fillpattern=(1, 2)) @@ -829,12 +843,14 @@ def amsco_transposition_encipher(message, keyword, fillpattern=(1,2)): >>> amsco_transposition_encipher('hereissometexttoencipher', 'cipher', fillpattern=(1, 3, 2)) 'hxomeiphscerettoisenteer' """ - grid = amsco_transposition_positions(message, keyword, fillpattern=fillpattern) + grid = amsco_transposition_positions(message, keyword, + fillpattern=fillpattern, fillstyle=fillstyle) ct_as_grid = [[message[s.start:s.end] for s in r] for r in grid] return combine_every_nth(ct_as_grid) -def amsco_transposition_decipher(message, keyword, fillpattern=(1,2)): +def amsco_transposition_decipher(message, keyword, + fillpattern=(1,2), fillstyle=AmscoFillStyle.reverse_each_row): """AMSCO transposition decipher >>> amsco_transposition_decipher('hoteelhler', 'abc', fillpattern=(1, 2)) @@ -853,7 +869,8 @@ def amsco_transposition_decipher(message, keyword, fillpattern=(1,2)): 'hereissometexttoencipher' """ - grid = amsco_transposition_positions(message, keyword, fillpattern=fillpattern) + grid = amsco_transposition_positions(message, keyword, + fillpattern=fillpattern, fillstyle=fillstyle) transposed_sections = [s for c in [l for l in zip(*grid)] for s in c] plaintext_list = [''] * len(transposed_sections) current_pos = 0 diff --git a/cipherbreak.py b/cipherbreak.py index 8a4d7b1..120a89e 100644 --- a/cipherbreak.py +++ b/cipherbreak.py @@ -465,6 +465,9 @@ def railfence_break(message, max_key_length=20, return max(results, key=lambda k: k[1]) def amsco_break(message, translist=transpositions, patterns = [(1, 2), (2, 1)], + fillstyles = [AmscoFillStyle.continuous, + AmscoFillStyle.same_each_row, + AmscoFillStyle.reverse_each_row], fitness=Pbigrams, chunksize=500): """Breaks an AMSCO transposition cipher using a dictionary and @@ -498,24 +501,26 @@ def amsco_break(message, translist=transpositions, patterns = [(1, 2), (2, 1)], (((2, 0, 5, 3, 1, 4, 6), (2, 1)), -997.0129085...) """ with Pool() as pool: - helper_args = [(message, trans, pattern, fitness) + helper_args = [(message, trans, pattern, fillstyle, fitness) for trans in translist.keys() - for pattern in patterns] + for pattern in patterns + for fillstyle in fillstyles] # Gotcha: the helper function here needs to be defined at the top level # (limitation of Pool.starmap) breaks = pool.starmap(amsco_break_worker, helper_args, chunksize) return max(breaks, key=lambda k: k[1]) def amsco_break_worker(message, transposition, - pattern, fitness): + pattern, fillstyle, fitness): plaintext = amsco_transposition_decipher(message, transposition, - fillpattern=pattern) + fillpattern=pattern, fillstyle=fillstyle) fit = fitness(sanitise(plaintext)) logger.debug('AMSCO transposition break attempt using key {0} and pattern' - '{1} gives fit of {2} and decrypt starting: {3}'.format( - transposition, pattern, fit, + '{1} ({2}) gives fit of {3} and decrypt starting: ' + '{4}'.format( + transposition, pattern, fillstyle, fit, sanitise(plaintext)[:50])) - return (transposition, pattern), fit + return (transposition, pattern, fillstyle), fit def hill_break(message, matrix_size=2, fitness=Pletters,