a,b,c=gets.split.map(&:to_i) p (b-c).abs>=(a-c).abs ? (a-c).abs+c : a