#include #include using namespace std; //文字列の要素はchar型なのでそのまま比較できる int main() { string sa,sb,pa,pb,xa,xb; cin >> sa >> pa >> xa >> sb >> pb >> xb; if(pa == pb) cout << -1 << endl; else if(pa.length() > pb.length()) cout << sa << endl; else if(pa.length() < pb.length()) cout << sb << endl; else cout << (pa > pb ? sa : sb) << endl; return 0; }