#include using namespace std; typedef unsigned long long ull; typedef long long ll; int main(){ string s[2], p[2], x[2]; for(int i=0; i<2; i++) cin >> s[i] >> p[i] >> x[i]; if(p[0].length()>p[1].length()){ cout << s[0] << endl; return 0; }else if(p[0].length()p[1][i]){ cout << s[0] << endl; return 0; }else if(p[0][i]