def middle_three_digits(num)
  
  
  num = num.abs

  
  length = (str = num.to_s).length

  
  raise ArgumentError,  if length < 3
  raise ArgumentError,  if length.even?

  return str[length/2 - 1, 3].to_i
end