def uru(N): if N%4!=0: return False if N%400==0: return True if N%100==0: return False return True def main(N,D): mina=365 maxa=0 maxa=max(maxa,365-D) maxa=min(maxa,N) if N=334: mina,maxa=main(N,D+1) else: mina,maxa=main(N,D) else: mina,maxa=main(N,D) print(mina,maxa)