


import math
import os
import sys



def     __lowerCAmelCase						(							snake_case	:    str )       ->							str:
   __lowerCamelCase:				List[str]     =	""""""
   try:
      with open(snake_case						,      """rb""" ) as binary_file:
         __lowerCamelCase:				Union[str, Any]     =	binary_file.read()
      for dat in data:
         __lowerCamelCase:				Any     =	f'{dat:08b}'
         result += curr_byte
      return result
   except OSError:
      print("""File not accessible""" )
      sys.exit()



def     __lowerCAmelCase						(							snake_case	:    dict[str, str]						,      snake_case	:    str						,      snake_case	:    int						,      snake_case	:    str )       ->							None:
   lexicon.pop(snake_case )
   __lowerCamelCase:				Tuple     =	last_match_id

   if math.loga(snake_case ).is_integer():
      for curr_key in lexicon:
         __lowerCamelCase:				Dict     =	"""0""" + lexicon[curr_key]

   __lowerCamelCase:				Optional[int]     =	bin(snake_case )[2:]



def     __lowerCAmelCase						(							snake_case	:    str )       ->							str:
   __lowerCamelCase:				Optional[Any]     =	{"""0""": """0""", """1""": """1"""}
   __lowerCamelCase   ,     __lowerCamelCase:				List[Any]     =	"""""", """"""
   __lowerCamelCase:				Optional[int]     =	len(snake_case )

   for i in range(len(snake_case ) ):
      curr_string += data_bits[i]
      if curr_string not in lexicon:
         continue

      __lowerCamelCase:				int     =	lexicon[curr_string]
      result += last_match_id
      add_key_to_lexicon(snake_case						,      snake_case						,      snake_case						,      snake_case )
      index += 1
      __lowerCamelCase:				List[Any]     =	""""""

   while curr_string != "" and curr_string not in lexicon:
      curr_string += "0"

   if curr_string != "":
      __lowerCamelCase:				int     =	lexicon[curr_string]
      result += last_match_id

   return result



def     __lowerCAmelCase						(							snake_case	:    str						,      snake_case	:    str )       ->							str:
   __lowerCamelCase:				str     =	os.path.getsize(snake_case )
   __lowerCamelCase:				Dict     =	bin(snake_case )[2:]
   __lowerCamelCase:				Tuple     =	len(snake_case )

   return "0" * (length_length - 1) + file_length_binary + compressed



def     __lowerCAmelCase						(							snake_case	:    str						,      snake_case	:    str )       ->							None:
   __lowerCamelCase:				Any     =	8
   try:
      with open(snake_case						,      """wb""" ) as opened_file:
         __lowerCamelCase:				Union[str, Any]     =	[
             to_write[i : i + byte_length]
             for i in range(0						,      len(snake_case )						,      snake_case )
         ]

         if len(result_byte_array[-1] ) % byte_length == 0:
            result_byte_array.append("""10000000""" )
         else:
            result_byte_array[-1] += "1" + "0" * (
                byte_length - len(result_byte_array[-1] ) - 1
            )

         for elem in result_byte_array:
            opened_file.write(int(snake_case						,      2 ).to_bytes(1						,      byteorder="""big""" ) )
   except OSError:
      print("""File not accessible""" )
      sys.exit()



def     __lowerCAmelCase						(							snake_case	:    str						,      snake_case	:    str )       ->							None:
   __lowerCamelCase:				Dict     =	read_file_binary(snake_case )
   __lowerCamelCase:				List[Any]     =	compress_data(snake_case )
   __lowerCamelCase:				Optional[Any]     =	add_file_length(snake_case						,      snake_case )
   write_file_binary(snake_case						,      snake_case )


if __name__ == "__main__":
   compress(sys.argv[1], sys.argv[2])






def     __lowerCAmelCase						(							)       ->							Optional[Any]:
   __lowerCamelCase:				List[str]     =	[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

   __lowerCamelCase:				List[str]     =	6
   __lowerCamelCase:				Optional[int]     =	1
   __lowerCamelCase:				int     =	1901

   __lowerCamelCase:				Tuple     =	0

   while year < 2001:
      day += 7

      if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
         if day > days_per_month[month - 1] and month != 2:
            month += 1
            __lowerCamelCase:				Union[str, Any]     =	day - days_per_month[month - 2]
         elif day > 29 and month == 2:
            month += 1
            __lowerCamelCase:				List[Any]     =	day - 29
      else:
         if day > days_per_month[month - 1]:
            month += 1
            __lowerCamelCase:				Any     =	day - days_per_month[month - 2]

      if month > 12:
         year += 1
         __lowerCamelCase:				Dict     =	1

      if year < 2001 and day == 1:
         sundays += 1
   return sundays


if __name__ == "__main__":
   print(solution())


