#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b A){ ll L = A.size(); FOR(i, 0, L){ if(i) cout << ' '; cout << A[i]; } cout << endl; } int main(){ cin.tie(0); ios::sync_with_stdio(false); // input string name0; cin >> name0; ll power0; cin >> power0; char c; cin >> c; string name1; cin >> name1; ll power1; cin >> power1; cin >> c; if(power0>power1){ p(name0); }else if(power0