from datetime import date, time, timedelta from typing import List y, n, d = map(int, input().split()) # print(y, n, d) born_lb: date = date(y-13, 4, 2) born_ub: date = date(y-12, 4, 1) date_lb: date = date(y, 4, 2) date_ub: date = date(y+1, 4, 1) lb_birthday: List[date] = [] ub_birthday: List[date] = [] for delta in range(n): lb_birthday.append(born_lb + timedelta(days=delta)) ub_birthday.append(born_ub - timedelta(days=delta)) date_lb41: date = date(y, 4, 1) dt = date_lb41 + timedelta(days=d) def isok(d: date, ma: date) -> bool: if d.month >= 4: if d.month == 4 and d.day == 1: return d.day == ma.day else: if ma.month >= 4: return d.month < ma.month or (d.month == ma.month and d.day <= ma.day) else: return True else: if ma.month >= 4: if ma.month == 4 and ma.day == 1: return True else: return False else: return d.month < ma.month or (d.month == ma.month and d.day <= ma.day) ma: int = 0 # print(lb_birthday, dt) for bd in lb_birthday: if isok(bd, dt): ma += 1 # else: # print(bd) mi: int = 0 # print(ub_birthday, dt) for bd in ub_birthday: if isok(bd, dt): mi += 1 print(n-ma, n-mi)