#include #include using namespace std; //FILE* fin=freopen("date.in","r",stdin); //FILE* fout=freopen("date.out","w",stdout); char echipe[5][100]; int puncte[5],goals[5]; int main() { int i,g1,g2,crt=0,ind1,ind2,j,maxim,pozmax; char t1[100],t2[100]; for (i=1; i<=6; i++) { scanf("%s %s %d %d",&t1,&t2,&g1,&g2); for (j=1; j<=crt; j++) { if (strcmp(echipe[j],t1)==0) {ind1=j; break;} } if (j==crt+1) { strcpy(echipe[j],t1); crt++; ind1=crt; } for (j=1; j<=crt; j++) { if (strcmp(echipe[j],t2)==0) {ind2=j; break;} } if (j==crt+1) { strcpy(echipe[j],t2); crt++; ind2=crt; } if (g1==g2) { puncte[ind1]++; puncte[ind2]++; } else { if( g1>g2) puncte[ind1]+=3; else puncte[ind2]+=3; } goals[ind1]+=g1; goals[ind2]+=g2; } for (i=1; i<=4; i++) { maxim=-1; pozmax=0; for (j=1; j<=4; j++) { if (puncte[j]>maxim) { maxim=puncte[j]; pozmax=j; continue; } if (puncte[j]==maxim) { if (goals[pozmax]