#include <bits/stdc++.h>
using namespace std;
long long n;
string a[110];
map<string, pair<long long, pair<long long, long long> > > m;
map<string, pair<long long, pair<long long, long long> > >::iterator it;
vector<pair<long long, pair<long long, pair<long long, string> > > > v;
vector<string> vv;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n * (n - 1) / 2; i++) {
    string s, t, match_a = "", match_b = "", score_a = "", score_b = "";
    long long sc1, sc2;
    cin >> s >> t;
    int j = 0;
    for (j = 0; j < s.size(); j++) {
      if (s[j] == '-') break;
      match_a += s[j];
    }
    j++;
    for (; j < s.size(); j++) match_b += s[j];
    for (j = 0; j < t.size(); j++) {
      if (t[j] == ':') break;
      score_a += t[j];
    }
    stringstream temp;
    temp << score_a;
    temp >> sc1;
    j++;
    for (; j < t.size(); j++) score_b += t[j];
    stringstream temp2;
    temp2 << score_b;
    temp2 >> sc2;
    if (sc1 > sc2)
      m[match_a].first += 3;
    else if (sc1 < sc2)
      m[match_b].first += 3;
    else
      m[match_a].first++, m[match_b].first++;
    m[match_a].second.first += (sc1 - sc2);
    m[match_b].second.first += (sc2 - sc1);
    m[match_a].second.second += sc1;
    m[match_b].second.second += sc2;
  }
  for (it = m.begin(); it != m.end(); it++) {
    v.push_back(
        {it->second.first,
         {it->second.second.first, {it->second.second.second, it->first}}});
  }
  sort(v.rbegin(), v.rend());
  for (int i = 0; i < v.size() / 2; i++)
    vv.push_back(v[i].second.second.second);
  sort(vv.begin(), vv.end());
  for (int i = 0; i < vv.size(); i++) cout << vv[i] << endl;
  return 0;
}
