input: from typing import List
  
  
  def find_mode(numbers: List[int]) -> int:
      """
      Returns the mode of the given list of integers, which is the number that appears most frequently.
      If there is more than one number with the highest frequency, the function returns the first one encountered.
      
      >>> find_mode([1, 2, 3, 2, 4, 2])
      2
      >>> find_mode([1, 2, 2, 3, 3, 3, 4, 4, 4, 4])
      4
      """
output:     frequency = {}
      for num in numbers:
          if num in frequency:
              frequency[num] += 1
          else:
              frequency[num] = 1
      
      max_freq = 0
      mode = None
      for num, freq in frequency.items():
          if freq > max_freq:
              max_freq = freq
              mode = num
      
      return mode