oc = 0 xc = 0 gets.chomp.chars.each do |s| if s == 'O' oc += 1 xc = 0 if oc == 3 puts 'East' exit end else xc += 1 oc = 0 if xc == 3 puts 'West' exit end end end puts 'NA'