as = gets.chars[0, 3].map(&:to_i) m, M = as.minmax puts M - m