#include #include #include #include using namespace std; int i,x,y,t; string a,b,e[10]; map m,g; bool sortare(string a,string b) { return (m[a]>m[b]||(m[a]==m[b]&&g[a]>g[b])||(m[a]==m[b]&&g[a]==g[b]&&a>a>>b>>x>>y; if (!m.count(a)) {m[a]=0; e[++t]=a;g[a]=0;} if (!m.count(b)) {m[b]=0; e[++t]=b;g[b]=0;} if (x>y) m[a]+=3; else if (x