sa, pa, _xa = gets.split sb, pb, _xb = gets.split case pa.to_i <=> pb.to_i when -1 then puts sb when 0 then puts(-1) when 1 then puts sa end