

import math
from itertools import permutations





def  _snake_case		(snake_case_					:     int  )							->		bool:

  if 1 < number < 4:
    # 2 and 3 are primes
    return True
  elif number < 2 or number % 2 == 0 or number % 3 == 0:
    # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
    return False

  # All primes number are in format of 6k +/- 1
  for i in range(5    ,       int(math.sqrt(snake_case_  ) + 1  )    ,       6  ):
    if number % i == 0 or number % (i + 2) == 0:
      return False
  return True





def  _snake_case		(snake_case_					:     int    ,       snake_case_					:     list  )							->		bool:
  __UpperCAmelCase,			__UpperCAmelCase	:  Tuple		=     0, len(snake_case_  ) - 1
  while left <= right:
    __UpperCAmelCase	:  Dict		=     (left + right) // 2
    if prime_list[middle] == target:
      return True
    elif prime_list[middle] < target:
      __UpperCAmelCase	:  int		=     middle + 1
    else:
      __UpperCAmelCase	:  Union[str, Any]		=     middle - 1

  return False





def  _snake_case		()							->		str:
  __UpperCAmelCase	:  str		=     [n for n in range(1001    ,       1_0000    ,       2  ) if is_prime(snake_case_  )]
  __UpperCAmelCase	:  Any		=     []

  for number in prime_list:
    __UpperCAmelCase	:  List[Any]		=     []

    for prime_member in permutations(list(str(snake_case_  )  )  ):
      __UpperCAmelCase	:  List[Any]		=     int(''.join(snake_case_  )  )

      if prime % 2 == 0:
        continue

      if search(snake_case_    ,       snake_case_  ):
        tmp_numbers.append(snake_case_  )

    tmp_numbers.sort()
    if len(snake_case_  ) >= 3:
      candidates.append(snake_case_  )

  __UpperCAmelCase	:  str		=     []
  for candidate in candidates:
    __UpperCAmelCase	:  Tuple		=     len(snake_case_  )
    __UpperCAmelCase	:  Union[str, Any]		=     False

    for i in range(snake_case_  ):
      for j in range(i + 1    ,       snake_case_  ):
        for k in range(j + 1    ,       snake_case_  ):
          if (
              abs(candidate[i] - candidate[j]  )
              == abs(candidate[j] - candidate[k]  )
              and len({candidate[i], candidate[j], candidate[k]}  ) == 3
          ):
            passed.append(
                sorted([candidate[i], candidate[j], candidate[k]]  )  )
            __UpperCAmelCase	:  Optional[Any]		=     True

          if found:
            break
        if found:
          break
      if found:
        break

  __UpperCAmelCase	:  int		=     set()
  for seq in passed:
    answer.add(''.join([str(snake_case_  ) for i in seq]  )  )

  return max(int(snake_case_  ) for x in answer  )


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









"""simple docstring"""






from __future__ import annotations

import sys


class       lowerCamelCase_		:





				"""simple docstring"""







				def __init__(    self							,		UpperCAmelCase__							,		UpperCAmelCase__  ):
								SCREAMING_SNAKE_CASE__  				=					letter
								SCREAMING_SNAKE_CASE__  				=					freq
								SCREAMING_SNAKE_CASE__  				=					{}






				def __repr__(    self  ):
								return f'''{self.letter}:{self.freq}'''


class       lowerCamelCase_		:





				"""simple docstring"""







				def __init__(    self							,		UpperCAmelCase__							,		UpperCAmelCase__							,		UpperCAmelCase__  ):
								SCREAMING_SNAKE_CASE__  				=					freq
								SCREAMING_SNAKE_CASE__  				=					left
								SCREAMING_SNAKE_CASE__  				=					right


def __lowercase  (   lowerCamelCase_	:   str	):
				SCREAMING_SNAKE_CASE__  				=					{}
				with open(lowerCamelCase_	) as f:
								while True:
												SCREAMING_SNAKE_CASE__  				=					f.read(1	)
												if not c:
																break
												SCREAMING_SNAKE_CASE__  				=					chars[c] + 1 if c in chars else 1
				return sorted((Letter(lowerCamelCase_    ,       lowerCamelCase_	) for c, f in chars.items())    ,       key=lambda lowerCamelCase_	: x.freq	)


def __lowercase  (   lowerCamelCase_	:   list[Letter]	):
				SCREAMING_SNAKE_CASE__  				=					letters  # type: ignore
				while len(lowerCamelCase_	) > 1:
								SCREAMING_SNAKE_CASE__  				=					response.pop(0	)
								SCREAMING_SNAKE_CASE__  				=					response.pop(0	)
								SCREAMING_SNAKE_CASE__  				=					left.freq + right.freq
								SCREAMING_SNAKE_CASE__  				=					TreeNode(lowerCamelCase_    ,       lowerCamelCase_    ,       lowerCamelCase_	)
								response.append(lowerCamelCase_	)
								response.sort(key=lambda lowerCamelCase_	: x.freq	)
				return response[0]


def __lowercase  (   lowerCamelCase_	:   Letter | TreeNode    ,       lowerCamelCase_	:   str	):
				if isinstance(lowerCamelCase_    ,       lowerCamelCase_	):
								SCREAMING_SNAKE_CASE__  				=					bitstring
								return [root]
				SCREAMING_SNAKE_CASE__  				=					root  # type: ignore
				SCREAMING_SNAKE_CASE__  				=					[]
				letters += traverse_tree(treenode.left    ,       bitstring + "0"	)
				letters += traverse_tree(treenode.right    ,       bitstring + "1"	)
				return letters


def __lowercase  (   lowerCamelCase_	:   str	):
				SCREAMING_SNAKE_CASE__  				=					parse_file(lowerCamelCase_	)
				SCREAMING_SNAKE_CASE__  				=					build_tree(lowerCamelCase_	)
				SCREAMING_SNAKE_CASE__  				=					{
				    k: v for letter in traverse_tree(lowerCamelCase_    ,       ""	) for k, v in letter.bitstring.items()
				}
				print(F'''Huffman Coding  of {file_path}: '''	)
				with open(lowerCamelCase_	) as f:
								while True:
												SCREAMING_SNAKE_CASE__  				=					f.read(1	)
												if not c:
																break
												print(letters[c]    ,       end=" "	)
				print()


if __name__ == "__main__":
	# pass the file path to the huffman function
	huffman(sys.argv[1])
