r=open(0).read() s="ive%our%four%three%Sad mother duck%Five little ducks%The sad m%M%Q%Quack, q%And all of the five%But only four%One little%Sad mother%M%The sad m%, quack.%.%But none%And all".split("%") for n in[[0,1],[2,3,4,5],[6,7,8,9]][ord(r[1])%3]:r=r.replace(s[n*2],s[n*2+1]) print(r)