



def 						UpperCAmelCase__   (   UpperCAmelCase__			:str			,       UpperCAmelCase__			:str       ):






 '''simple docstring'''

 if not isinstance(UpperCAmelCase__			,       UpperCAmelCase__       ):
  raise TypeError("plaintext must be a string"       )
 if not isinstance(UpperCAmelCase__			,       UpperCAmelCase__       ):
  raise TypeError("key must be a string"       )

 if not plaintext:
  raise ValueError("plaintext is empty"       )
 if not key:
  raise ValueError("key is empty"       )

 key += plaintext
 a							=		plaintext.lower()
 a							=		key.lower()
 a							=		0
 a							=		0
 a							=		""
 while plaintext_iterator < len(UpperCAmelCase__       ):
  if (
      ord(plaintext[plaintext_iterator]       ) < 97
      or ord(plaintext[plaintext_iterator]       ) > 1_22
  ):
   ciphertext += plaintext[plaintext_iterator]
   plaintext_iterator += 1
  elif ord(key[key_iterator]       ) < 97 or ord(key[key_iterator]       ) > 1_22:
   key_iterator += 1
  else:
   ciphertext += chr(
       (
           (ord(plaintext[plaintext_iterator]       ) - 97 + ord(key[key_iterator]       ))
           - 97
       )
       % 26
       + 97       )
   key_iterator += 1
   plaintext_iterator += 1
 return ciphertext


def 						UpperCAmelCase__   (   UpperCAmelCase__			:str			,       UpperCAmelCase__			:str       ):






 '''simple docstring'''

 if not isinstance(UpperCAmelCase__			,       UpperCAmelCase__       ):
  raise TypeError("ciphertext must be a string"       )
 if not isinstance(UpperCAmelCase__			,       UpperCAmelCase__       ):
  raise TypeError("key must be a string"       )

 if not ciphertext:
  raise ValueError("ciphertext is empty"       )
 if not key:
  raise ValueError("key is empty"       )

 a							=		key.lower()
 a							=		0
 a							=		0
 a							=		""
 while ciphertext_iterator < len(UpperCAmelCase__       ):
  if (
      ord(ciphertext[ciphertext_iterator]       ) < 97
      or ord(ciphertext[ciphertext_iterator]       ) > 1_22
  ):
   plaintext += ciphertext[ciphertext_iterator]
  else:
   plaintext += chr(
       (ord(ciphertext[ciphertext_iterator]       ) - ord(key[key_iterator]       )) % 26
       + 97       )
   key += chr(
       (ord(ciphertext[ciphertext_iterator]       ) - ord(key[key_iterator]       )) % 26
       + 97       )
   key_iterator += 1
  ciphertext_iterator += 1
 return plaintext


if __name__ == "__main__":
     import doctest

     doctest.testmod()
     A_		:  Union[str, Any]										=  int(input('''Type 1 to encrypt or 2 to decrypt:'''))
     if operation == 1:
          A_		:  int										=  input('''Typeplaintext to be encrypted:\n''')
          A_		:  Dict										=  input('''Type the key:\n''')
          print(encrypt(plaintext, key))
     elif operation == 2:
          A_		:  Tuple										=  input('''Type the ciphertext to be decrypted:\n''')
          A_		:  Dict										=  input('''Type the key:\n''')
          print(decrypt(ciphertext, key))
     decrypt('''jsqqs avvwo''', '''coffee''')





'''simple docstring'''


import io
import json
import subprocess


lowerCamelCase__     						=  [
    ['en', 'ru'],
    ['ru', 'en'],
    ['en', 'de'],
    ['de', 'en'],
]

lowerCamelCase__     						=  8






def 			__lowerCAmelCase			(__lowerCAmelCase   ,			__lowerCAmelCase ):
		_UpperCAmelCase		:							List[str]             =   {}
		for src, tgt in pairs:
				_UpperCAmelCase		:							Tuple             =   F"""{src}-{tgt}"""
				_UpperCAmelCase		:							Tuple             =   F"""sacrebleu -t wmt19 -l {pair} --echo src""".split()
				_UpperCAmelCase		:							List[Any]             =   subprocess.run(__lowerCAmelCase   ,			stdout=subprocess.PIPE ).stdout.decode("utf-8" ).splitlines()
				_UpperCAmelCase		:							Tuple             =   F"""sacrebleu -t wmt19 -l {pair} --echo ref""".split()
				_UpperCAmelCase		:							List[str]             =   subprocess.run(__lowerCAmelCase   ,			stdout=subprocess.PIPE ).stdout.decode("utf-8" ).splitlines()
				_UpperCAmelCase		:							Tuple             =   {"src": src_lines[:n_objs], "tgt": tgt_lines[:n_objs]}
		return text


lowerCamelCase__     						=  get_all_data(pairs, n_objs)
lowerCamelCase__     						=  './fsmt_val_data.json'
with io.open(filename, 'w', encoding='utf-8') as f:
						lowerCamelCase__     						=  json.dump(text, f, indent=2, ensure_ascii=False)



