a='%d bottle%s of beer' b=' on the wall' d="%s, %s.\n%%s, %s."%(a+b,a,a+b) f=lambda x: x!=1 and 's' or '' g=lambda x: x==1 and 'Go to the store and buy some more' or 'Take one down and pass it around' print '\n\n'.join([d%(x,f(x),x,f(x),g(x),x-1 or 99,f(x-1)) for x in range(99,0,-1)])