Problem:
Problem B: Hyper Rock-Scissors-Paper

Rock-Scissors-Paper is a game played with hands and often used for random choice of a person for some
purpose. Today, we have got an extended version, namely, Hyper Rock-Scissors-Paper (or Hyper RSP
for short).

In a game of Hyper RSP, the players simultaneously presents their hands forming any one of the following
15 gestures: Rock, Fire, Scissors, Snake, Human, Tree, Wolf, Sponge, Paper, Air, Water, Dragon, Devil,
Lightning, and Gun.

Figure 1: Hyper Rock-Scissors-Paper

The arrows in the figure above show the defeating relation. For example, Rock defeats Fire, Scissors,
Snake, Human, Tree, Wolf, and Sponge. Fire defeats Scissors, Snake, Human, Tree, Wolf, Sponge, and
Paper. Generally speaking, each hand defeats other seven hands located after in anti-clockwise order in
the figure. A player is said to win the game if the player’s hand defeats at least one of the other hands,
and is not defeated by any of the other hands.

Your task is to determine the winning hand, given multiple hands presented by the players.

Input

The input consists of a series of data sets. The first line of each data set is the number N of the players
(N < 1000). The next N lines are the hands presented by the players.

The end of the input is indicated by a line containing single zero.

Output

For each data set, output the winning hand in a single line. When there are no winners in the game,
output “Draw” (without quotes).

Sample Input

8
Lightning
Gun
Paper
Sponge
Water
Dragon
Devil
Air
3
Rock
Scissors
Paper
0

Output for the Sample Input

Sponge
Draw

Solution in Ruby (judge verdict: Wrong Answer)

### constant

HANDS = [
  "Rock", "Fire", "Scissors", "Snake", "Human",
  "Tree", "Wolf", "Sponge", "Paper", "Air",
  "Water", "Dragon", "Devil", "Lightning", "Gun"
]

NH = HANDS.length
NW = (NH - 1) / 2
  
### main

hhash = {}
for i in (0...NH)
  hhash[HANDS[i]] = i
end

wlmtx = Array.new(NH){Array.new(NH){0}}
for i in (0...NH)
  for j in (1..NW)
    k = (i + j) % NH
    wlmtx[i][k] = 1
    wlmtx[k][i] = -1
  end
end
#p wlmtx

loop do
  n = gets.to_i
  break if n == 0

  hs = Array.new(n){hhash[gets.strip]}
  ws = Array.new(n){0}
  ls = Array.new(n){0}

  for i in (0...n)
    for j in (0...n)
      next if i == j

      wl = wlmtx[hs[i]][hs[j]]
      if wl > 0
        ws[i] += 1
      else
        ls[i] += 1
      end
    end
  end
  #p [ws, ls]

  win = 'Draw'
  for i in (0...n)
    if ws[i] > 0 && ls[i] == 0
      win = HANDS[hs[i]]
      break
    end
  end

  puts win
end