#include #include #include #include #include using namespace std; string t1, t2; int g1, g2; map points, goals; pair > data[4]; int main() { // freopen("data.in", "r", stdin); for(int i=0; i<6; ++i) { cin>>t1>>t2>>g1>>g2; goals[t1]=goals[t1]+g1; goals[t2]=goals[t2]+g2; if(g1>g2) points[t1] = points[t1]+3; if(g1 :: iterator it = goals.begin(); it != goals.end(); ++it) data[x++]=make_pair(-points[it->first], make_pair(-(it->second), it->first)); sort(data, data+4); for(int i=0; i<4; ++i) cout<