n=gets.to_i-1 a=n*2-gets.split.map(&:to_i).max/2 puts [a+1,n-a]*" "