a = gets.split b = gets.split ap = a[1].to_i bp = b[1].to_i if ap > bp puts a[0] elsif ap < bp puts b[0] else puts -1 end