require "date" Y, N, D = gets.split.map(&:to_i) t0 = DateTime.new(Y, 4, 1, 20, 0, 0) t1 = t0 + D a = 0 N.times do |i| d = t0.prev_year + 1 + i a += 1 if t1 < d.next_year end b = 0 N.times do |i| d = t0 - i b += 1 if t1 < d.next_year end puts [a, b].minmax * " "