Implement two classic ciphers on letters, preserving case. Non-letters pass through unchanged, and don't consume key letters.
caesar(text, shift): shift each letter by shift places (negative shifts work, and the alphabet wraps).vigenere(text, key, decrypt=False): shift each letter by the value of the next key letter (a=0 … z=25, case-insensitive), cycling through the key. Decryption shifts the other way. Raise ValueError if the key contains non-letters or is empty.Then implement crack_caesar(ciphertext): try all 26 shifts and return the shift whose decryption has the most occurrences of the letters e, t, a, o, i and n (smallest shift on ties). Return the encryption shift, so caesar(ciphertext, -shift) decrypts.