players = %w[oda yukiko] S = gets.chomp stone_num = 0 readlines.each do |l| stone_num += l.scan(/[wb]/).size end if stone_num.odd? puts (players - [S]).first else puts (players & [S]).first end