import string, collections, re

def generate_key(rot):
    return zip(string.ascii_lowercase, string.ascii_uppercase[rot:] + string.ascii_uppercase[:rot])

def decipher(ciphertext, rot):
    key = generate_key(rot)
    for x, y in key:
        ciphertext = ciphertext.replace(x, y)
    return ciphertext

def brute_force(ciphertext):
    print("\nBrute Force Approach\n")
    for rot in range(1, 26):
        arrow = "<========== LOOK HERE" if rot == 7 else "" # we know the 7th row will contain the correct decrypt
        print("{rot:02d}: ".format(rot=rot), decipher(ciphertext, rot), arrow)

if __name__ == "__main__":
    ciphertext = "maxzxxlxmatmetbwmaxzhewxgxzzltgwgxoxkvtvdexw"
    brute_force(ciphertext)
    print("Lab Answer: This was said by Churchill about Turing and friends at Bletchley Park\n")
