99.times do |i|x=99-i a="of beer on the wall";b=(x>1?"bottles":"bottle") puts("#{x} #{b} #{a}, #{x} #{b} of beer.\n"+(x==1?"Go to the store and buy some more, 99 #{b}s #{a}.":"Take one down and pass it around, #{x-1} #{x>2?b:"bottle"} #{a}.\n\n")) end