V Qc@sbddlZddlZddlZdZdZdZdZedkr^endS(iNc Cstjdr#ttjd}nttd}d|koLdknrsdG|G|d}dG|GdGHn3d |kotjdknsd G|GHdStjd rttjd }nttd }d|kod knsdG|GHdStjdr'ttjd}nttd}|d kr]tj|r]d}n tj|}d|ko|knsdG|GdGHdS|||f}t |}dGt |GHtjd }t |}dGt |GH||krdGHdS||krdGHdS||}dG|GdGHd} xQt ||ddD]8} || ||fkoq|knrK| d} qKqKWdG| GdGH|d|dkrdGt | GdGHdGndGt || Gd GHdS(!NisIn which year were you born? iidsI'll assume that byilsyou meansand not the early Christian erai:s%It's hard to believe you were born inisAnd in which month? (1-12) i sThere is no month numberedis&And on what day of that month? (1-31) is There are nosdays in that month!sYou were born onsToday iss0You are a time traveler. Go back to the future!s'You were born today. Have a nice life!sYou have livedtdayssYou ares years oldsCongratulations! Today is yourtbirthdaysYesterday was yours Today is yourt unbirthday( tsystargvtintt raw_inputttimet localtimetcalendartisleaptmdaystmkdatetformattrangetnth( tyeartmonthtdaytmaxdayt bdaytupletbdaydatet todaytuplet todaydateRtagety((s//usr/lib64/python2.7/Demo/scripts/unbirthday.pytmain sb  &             % cCs'|\}}}d|tj||fS(Ns%d %s %d(R t month_name(t.0RRR((s//usr/lib64/python2.7/Demo/scripts/unbirthday.pyR Ns cCs8|dkrdS|dkr dS|dkr0dSd|S(Nit1stit2ndit3rds%dth((tn((s//usr/lib64/python2.7/Demo/scripts/unbirthday.pyRQs   cCs|\}}}|d}||dd}||dd}||dd}xPtd|D]?}|d krtj|r|d }q_|tj|}q_W||}|S( Nimiiicidiiiii(RR R R (RRRRRti((s//usr/lib64/python2.7/Demo/scripts/unbirthday.pyR Ws    t__main__(RRR RR RR t__name__(((s//usr/lib64/python2.7/Demo/scripts/unbirthday.pyts    B