Y, N, D = gets.split.map(&:to_i) min = [0, N - D].max max = N - [0, (D - (365 - N))].max puts [min, max].join(' ')