sa, pa, xa = gets.split sb, pb, xb = gets.split pa = pa.to_i pb = pb.to_i puts sa if pa > pb puts sb if pa < pb puts -1 if pa == pb