gets gets nums = readlines.map(&:to_i).sort puts nums.last - nums.first