

from __future__ import annotations





def 	snake_case_      (__A     :						int					,   __A     :						int					,   __A     :						int     )			->	int:
   assert n > 1 and a > 0 and greatest_common_divisor(__A					,   __A     ) == 1
   ((__lowerCAmelCase)    ,(__lowerCAmelCase)    ,(__lowerCAmelCase))  :			Any					    =						extended_gcd(__A					,   __A     )  # Implemented below
   __lowerCAmelCase  :			Any					    =						(b * s) % n
   return x





def 	snake_case_      (__A     :						int					,   __A     :						int     )			->	int:
   ((__lowerCAmelCase)    ,(__lowerCAmelCase))  :			int					    =						extended_euclid(__A					,   __A     )  # Implemented below
   if b < 0:
      __lowerCAmelCase  :			str					    =						(b % n + n) % n
   return b





def 	snake_case_      (__A     :						int					,   __A     :						int					,   __A     :						int     )			->	int:
   __lowerCAmelCase  :			int					    =						invert_modulo(__A					,   __A     )
   __lowerCAmelCase  :			Dict					    =						(b * s) % n
   return x





def 	snake_case_      (__A     :						int					,   __A     :						int     )			->	tuple[int, int, int]:
   assert a >= 0 and b >= 0

   if b == 0:
      __lowerCAmelCase    ,__lowerCAmelCase    ,__lowerCAmelCase  :			Optional[int]					    =						a, 1, 0
   else:
      ((__lowerCAmelCase)    ,(__lowerCAmelCase)    ,(__lowerCAmelCase))  :			List[str]					    =						extended_gcd(__A					,   a % b     )
      __lowerCAmelCase  :			Union[str, Any]					    =						q
      __lowerCAmelCase  :			Any					    =						p - q * (a // b)

   assert a % d == 0 and b % d == 0
   assert d == a * x + b * y

   return (d, x, y)





def 	snake_case_      (__A     :						int					,   __A     :						int     )			->	tuple[int, int]:
   if b == 0:
      return (1, 0)
   ((__lowerCAmelCase)    ,(__lowerCAmelCase))  :			Optional[Any]					    =						extended_euclid(__A					,   a % b     )
   __lowerCAmelCase  :			Union[str, Any]					    =						a // b
   return (y, x - k * y)





def 	snake_case_      (__A     :						int					,   __A     :						int     )			->	int:
   if a < b:
      __lowerCAmelCase    ,__lowerCAmelCase  :			int					    =						b, a

   while a % b != 0:
      __lowerCAmelCase    ,__lowerCAmelCase  :			str					    =						b, a % b

   return b


if __name__ == "__main__":
   from doctest import testmod

   testmod(name="""modular_division""", verbose=True)
   testmod(name="""modular_division2""", verbose=True)
   testmod(name="""invert_modulo""", verbose=True)
   testmod(name="""extended_gcd""", verbose=True)
   testmod(name="""extended_euclid""", verbose=True)
   testmod(name="""greatest_common_divisor""", verbose=True)









import io
import json
import subprocess


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

_UpperCAmelCase				       = 8




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


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

