C=',' c='On the %s day of Christmas,my true love sent to me\n' e='f'+'th,'*7+'fth,th,ird,second,' a='Twelve drummers drumm|Eleven pipers pip|Ten lords a-leap|Nine ladies danc|Eight maids a-milk|Seven swans a-swimm|Six geese a-lay|Five golden rings,Four calling birds,Three French hens,Two turtle doves,And a partridge in a pear tree.'.replace('|','ing,') x='' i=2423543364 while e:E,e=e.split(C,1);x='\n\n'+c%(a[:i%10].lower()+E)+a+x;a=a[a.find(C)+1:];i/=10 print(c%'first'+'A'+a[5:]+x[:-1]+'!').replace(C,',\n')