"""simple docstring"""


__UpperCamelCase										=     {
    "A": ("ABCDEFGHIJKLM", "NOPQRSTUVWXYZ"),
    "B": ("ABCDEFGHIJKLM", "NOPQRSTUVWXYZ"),
    "C": ("ABCDEFGHIJKLM", "ZNOPQRSTUVWXY"),
    "D": ("ABCDEFGHIJKLM", "ZNOPQRSTUVWXY"),
    "E": ("ABCDEFGHIJKLM", "YZNOPQRSTUVWX"),
    "F": ("ABCDEFGHIJKLM", "YZNOPQRSTUVWX"),
    "G": ("ABCDEFGHIJKLM", "XYZNOPQRSTUVW"),
    "H": ("ABCDEFGHIJKLM", "XYZNOPQRSTUVW"),
    "I": ("ABCDEFGHIJKLM", "WXYZNOPQRSTUV"),
    "J": ("ABCDEFGHIJKLM", "WXYZNOPQRSTUV"),
    "K": ("ABCDEFGHIJKLM", "VWXYZNOPQRSTU"),
    "L": ("ABCDEFGHIJKLM", "VWXYZNOPQRSTU"),
    "M": ("ABCDEFGHIJKLM", "UVWXYZNOPQRST"),
    "N": ("ABCDEFGHIJKLM", "UVWXYZNOPQRST"),
    "O": ("ABCDEFGHIJKLM", "TUVWXYZNOPQRS"),
    "P": ("ABCDEFGHIJKLM", "TUVWXYZNOPQRS"),
    "Q": ("ABCDEFGHIJKLM", "STUVWXYZNOPQR"),
    "R": ("ABCDEFGHIJKLM", "STUVWXYZNOPQR"),
    "S": ("ABCDEFGHIJKLM", "RSTUVWXYZNOPQ"),
    "T": ("ABCDEFGHIJKLM", "RSTUVWXYZNOPQ"),
    "U": ("ABCDEFGHIJKLM", "QRSTUVWXYZNOP"),
    "V": ("ABCDEFGHIJKLM", "QRSTUVWXYZNOP"),
    "W": ("ABCDEFGHIJKLM", "PQRSTUVWXYZNO"),
    "X": ("ABCDEFGHIJKLM", "PQRSTUVWXYZNO"),
    "Y": ("ABCDEFGHIJKLM", "OPQRSTUVWXYZN"),
    "Z": ("ABCDEFGHIJKLM", "OPQRSTUVWXYZN"),
}







def    UpperCAmelCase       (						UpperCAmelCase   )							-> list[tuple[str, str]]:
     return [alphabet[char] for char in key.upper()]







def    UpperCAmelCase       (						UpperCAmelCase		,   UpperCAmelCase   )							-> str:
     snake_case_   			=   ''''''
     snake_case_   			=   0
     snake_case_   			=   generate_table(SCREAMING_SNAKE_CASE__   )
     for char in words.upper():
          cipher += get_opponent(table[count]		,   SCREAMING_SNAKE_CASE__   )
          snake_case_   			=   (count + 1) % len(SCREAMING_SNAKE_CASE__   )
     return cipher







def    UpperCAmelCase       (						UpperCAmelCase		,   UpperCAmelCase   )							-> str:
     return encrypt(SCREAMING_SNAKE_CASE__		,   SCREAMING_SNAKE_CASE__   )







def    UpperCAmelCase       (						UpperCAmelCase		,   UpperCAmelCase   )							-> tuple[int, int]:
     snake_case_   			=   0 if char in table[0] else 1
     snake_case_   			=   table[row].index(SCREAMING_SNAKE_CASE__   )
     return row, col







def    UpperCAmelCase       (						UpperCAmelCase		,   UpperCAmelCase   )							-> str:
     snake_case_   			=   get_position(SCREAMING_SNAKE_CASE__		,   char.upper()   )
     if row == 1:
          return table[0][col]
     else:
          return table[1][col] if row == 0 else char


if __name__ == "__main__":
    import doctest

    doctest.testmod()  # Fist ensure that all our tests are passing...
    __UpperCamelCase										=     input('''Enter key: ''').strip()
    __UpperCamelCase										=     input('''Enter text to encrypt: ''').strip()
    __UpperCamelCase										=     encrypt(key, text)

    print(F"""Encrypted: {cipher_text}""")
    print(F"""Decrypted with key: {decrypt(key, cipher_text)}""")








'''simple docstring'''







import argparse
import json
import re
import string
import sys
from collections import Counter





def 							lowerCamelCase_   (	SCREAMING_SNAKE_CASE__   :      Optional[Any] )			->						str:

						def remove_articles(SCREAMING_SNAKE_CASE__   :      Union[str, Any] ):
												return re.sub(R'''\b(a|an|the)\b''',      ''' ''',      SCREAMING_SNAKE_CASE__ )

						def white_space_fix(SCREAMING_SNAKE_CASE__   :      Dict ):
												return " ".join(text.split() )

						def remove_punc(SCREAMING_SNAKE_CASE__   :      Union[str, Any] ):
												UpperCAmelCase_      :   int      =	set(string.punctuation )
												return "".join(ch for ch in text if ch not in exclude )

						def lower(SCREAMING_SNAKE_CASE__   :      str ):
												return text.lower()

						return white_space_fix(remove_articles(remove_punc(lower(SCREAMING_SNAKE_CASE__ ) ) ) )





def 							lowerCamelCase_   (	SCREAMING_SNAKE_CASE__   :      Union[str, Any],      SCREAMING_SNAKE_CASE__   :      Union[str, Any] )			->						Tuple:
						UpperCAmelCase_      :   List[Any]      =	normalize_answer(SCREAMING_SNAKE_CASE__ ).split()
						UpperCAmelCase_      :   Optional[Any]      =	normalize_answer(SCREAMING_SNAKE_CASE__ ).split()
						UpperCAmelCase_      :   Any      =	Counter(SCREAMING_SNAKE_CASE__ ) & Counter(SCREAMING_SNAKE_CASE__ )
						UpperCAmelCase_      :   Tuple      =	sum(common.values() )
						if num_same == 0:
												return 0
						UpperCAmelCase_      :   Union[str, Any]      =	1.0 * num_same / len(SCREAMING_SNAKE_CASE__ )
						UpperCAmelCase_      :   Dict      =	1.0 * num_same / len(SCREAMING_SNAKE_CASE__ )
						UpperCAmelCase_      :   str      =	(2 * precision * recall) / (precision + recall)
						return fa





def 							lowerCamelCase_   (	SCREAMING_SNAKE_CASE__   :      int,      SCREAMING_SNAKE_CASE__   :      int )			->						Any:
						return normalize_answer(SCREAMING_SNAKE_CASE__ ) == normalize_answer(SCREAMING_SNAKE_CASE__ )





def 							lowerCamelCase_   (	SCREAMING_SNAKE_CASE__   :      Union[str, Any],      SCREAMING_SNAKE_CASE__   :      Any,      SCREAMING_SNAKE_CASE__   :      Dict )			->						Optional[int]:
						UpperCAmelCase_      :   Dict      =	[]
						for ground_truth in ground_truths:
												UpperCAmelCase_      :   str      =	metric_fn(SCREAMING_SNAKE_CASE__,      SCREAMING_SNAKE_CASE__ )
												scores_for_ground_truths.append(SCREAMING_SNAKE_CASE__ )
						return max(SCREAMING_SNAKE_CASE__ )





def 							lowerCamelCase_   (	SCREAMING_SNAKE_CASE__   :      List[str],      SCREAMING_SNAKE_CASE__   :      Optional[Any] )			->						Any:
						UpperCAmelCase_      :   str      =	0
						for article in dataset:
												for paragraph in article["paragraphs"]:
																		for qa in paragraph["qas"]:
																								total += 1
																								if qa["id"] not in predictions:
																														UpperCAmelCase_      :   Union[str, Any]      =	'''Unanswered question ''' + qa['''id'''] + ''' will receive score 0.'''
																														print(SCREAMING_SNAKE_CASE__,      file=sys.stderr )
																														continue
																								UpperCAmelCase_      :   Optional[Any]      =	[x['''text'''] for x in qa['''answers''']]
																								UpperCAmelCase_      :   int      =	predictions[qa['''id''']]
																								exact_match += metric_max_over_ground_truths(SCREAMING_SNAKE_CASE__,      SCREAMING_SNAKE_CASE__,      SCREAMING_SNAKE_CASE__ )
																								fa += metric_max_over_ground_truths(SCREAMING_SNAKE_CASE__,      SCREAMING_SNAKE_CASE__,      SCREAMING_SNAKE_CASE__ )

						UpperCAmelCase_      :   Any      =	1_00.0 * exact_match / total
						UpperCAmelCase_      :   Optional[int]      =	1_00.0 * fa / total

						return {"exact_match": exact_match, "f1": fa}


if __name__ == "__main__":
					snake_case_  :							Any            =	"1.1"
					snake_case_  :							Any            =	argparse.ArgumentParser(description="Evaluation for SQuAD " + expected_version)
					parser.add_argument("dataset_file", help="Dataset file")
					parser.add_argument("prediction_file", help="Prediction File")
					snake_case_  :							int            =	parser.parse_args()
					with open(args.dataset_file) as dataset_file:
										snake_case_  :							List[Any]            =	json.load(dataset_file)
										if dataset_json["version"] != expected_version:
															print(
															    "Evaluation expects v-" + expected_version + ", but got dataset with v-" + dataset_json["version"],
															    file=sys.stderr,
															)
										snake_case_  :							Tuple            =	dataset_json["data"]
					with open(args.prediction_file) as prediction_file:
										snake_case_  :							Tuple            =	json.load(prediction_file)
					print(json.dumps(evaluate(dataset, predictions)))





