a=gets.split.map &:to_i;a=[a.min+1,a.sort[1],a.max-2]while a.max-a.min>2;p a.min