#include #define endl '\n' #define MAXN 2000 using namespace std; int main() { string a, b; string c, d; char e, f; cin >> a >> c >> e; cin >> b >> d >> f; if(c > d) cout << a << endl; else if(c < d) cout << b << endl; else cout << -1 << endl; return 0; }