class FizzBuzz include Enumerable def each i = [].size loop do i=i.succ; yield i i=i.succ; yield i i=i.succ; yield "Fizz" i=i.succ; yield i i=i.succ; yield "Buzz" i=i.succ; yield "Fizz" i=i.succ; yield i i=i.succ; yield i i=i.succ; yield "Fizz" i=i.succ; yield "Buzz" i=i.succ; yield i i=i.succ; yield "Fizz" i=i.succ; yield i i=i.succ; yield i i=i.succ; yield "FizzBuzz" end end end puts FizzBuzz.new.take(gets.to_i)