# 3083 : 12歳 import calendar import datetime from sys import stdin year,numSt,daysAfter=list(map(int,stdin.readline().split())) isLeapYear=1 if calendar.isleap(year+1) else 0 dt41=datetime.datetime(year=year, month=4, day=1) dt228=datetime.datetime(year=year+1, month=2, day=28) dtLeap=dt228-dt41 if not isLeapYear: minNumSt=max(numSt-daysAfter,0) elif daysAfter<=dtLeap.days: minNumSt=max(numSt-daysAfter,0) else: minNumSt=max(numSt-daysAfter+1,0) maxNumSt=min(numSt,(365+isLeapYear)-daysAfter) print('{0} {1}'.format(minNumSt,maxNumSt))