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