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