def suite(card)
  card[1]
end
def rank(card)
  case card[0]
    when "2".."9"
      return card[0].to_i
    when "T"
      return 10
    when "J"
      return 11
    when "Q"
      return 12
    when "K"
      return 13
    when "A"
      return 14
  end
end
def less(card1, card2, lead, trump)
  cost1 = rank(card1)
  cost1 += 13 if suite(card1) == lead
  cost1 += 26 if suite(card1) == trump
  cost2 = rank(card2)
  cost2 += 13 if suite(card2) == lead
  cost2 += 26 if suite(card2) == trump
  cost1 < cost2
end

N, E, S, W = (0...4).to_a
while (trump = gets.chomp) != "#" do
  card = Array.new
  4.times do
    card.push(gets.chomp.split)
  end
  point = Array.new(2, 0)
  lead = E
  13.times do |trick|
    winner = lead
    4.times do |i|
      winner = i if less(card[winner][trick], card[i][trick], suite(card[lead][trick]), trump)
    end
    lead = winner
    point[winner&1] += 1
  end
  puts point[0]>point[1] ? "NS #{point[0]-6}" : "EW #{point[1]-6}"
end