s1, p1, x1 = gets.split; p1 = p1.to_i s2, p2, x2 = gets.split; p2 = p2.to_i puts case p1 <=> p2 when 1 then s1 when -1 then s2 when 0 then -1 end