import std.stdio, std.conv, std.math, std.string, std.range, std.array, std.algorithm, std.bigint; void main() { auto buf = readln().strip().split(); auto name1 = buf[0].to!string(); auto point1 = buf[1].to!BigInt(); auto buf2 = readln().strip().split(); auto name2 = buf2[0].to!string(); auto point2 = buf2[1].to!BigInt(); if (point1 > point2) { writeln(name1); } else if(point2 > point1) { writeln(name2); } else { writeln(-1); } }