results = gets.chomp if (results.index("OOO") || 9999999) < (results.index("XXX") || 9999999) puts "East" exit end if (results.index("OOO") || 9999999) > (results.index("XXX") || 9999999) puts "West" exit end puts "NA"