






from collections import Counter
from functools import total_ordering

from data_structures.heap.heap import Heap


@total_ordering
class        _lowerCAmelCase:





       """simple docstring"""







       def __init__(      self						,    _lowerCamelCase						,    _lowerCamelCase							):
         UpperCamelCase_:      Optional[Any]					   =       word
         UpperCamelCase_:      int					   =       count





       def __eq__(      self						,    _lowerCamelCase							):
         if not isinstance(_lowerCamelCase						,    _lowerCamelCase							):
           return NotImplemented
         return self.count == other.count





       def __lt__(      self						,    _lowerCamelCase							):
         if not isinstance(_lowerCamelCase						,    _lowerCamelCase							):
           return NotImplemented
         return self.count < other.count







def 						snake_case      (UpperCAmelCase__			,					UpperCAmelCase__						) ->       list[str]:
  UpperCamelCase_:      Heap[WordCount]					   =       Heap()
  UpperCamelCase_:      Tuple					   =       Counter(UpperCAmelCase__						)
  heap.build_max_heap(
      [WordCount(UpperCAmelCase__			,					UpperCAmelCase__						) for word, count in count_by_word.items()]						)
  return [heap.extract_max().word for _ in range(min(UpperCAmelCase__			,					len(UpperCAmelCase__						)						)						)]


if __name__ == "__main__":
   import doctest

   doctest.testmod()







from math import factorial

def 						snake_case      (UpperCAmelCase__			,					UpperCAmelCase__						) ->       Dict:
  return factorial(UpperCAmelCase__						) / (factorial(UpperCAmelCase__						) * factorial(n - r						))

def 						snake_case      () ->       Optional[Any]:
  UpperCamelCase_:      int					   =       0

  for i in range(1			,					1_0_1						):
    for j in range(1			,					i + 1						):
      if combinations(UpperCAmelCase__			,					UpperCAmelCase__						) > 1E6:
        total += 1
  return total


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