# -*- encoding: utf-8 -*-

lines = gets.str.rstrip.split(/\r?\n/).map(&:to_i)

result = 0

lines.each do |i|
  lines.each do |j|
  	diff = lines[i] - lines[j]
  	if result < diff && i > j
  	  result = diff
  	end
  end
end

p result