count=0
ask=''

while ask=gets.chomp
  if ask == 'BYE'
  then
    year=(1950+rand(21)).to_s
    puts "いやー、"+year+ "年以来ないねー!"
    count = count + 1
  else
    puts "は?! もっと大きな声で話しておくれ、坊や!"
    count = 0
  end

  if count == 3
  then
    exit
  end
end