#include <bits/stdc++.h>
using namespace std;
map<string, int> mp;
map<string, int> ms;
map<string, int> mm;
map<string, int>::iterator it;
struct team {
  string name;
  int goal;
  int scored;
  int miss;
} tt[55];
bool cmp1(team a, team b) {
  if (a.goal == b.goal) {
    if (a.scored - a.miss == b.scored - b.miss) {
      return a.scored > b.scored;
    }
    return a.scored - a.miss > b.scored - b.miss;
  }
  return a.goal > b.goal;
}
bool cmp2(team a, team b) { return a.name.compare(b.name) < 0; }
int main() {
  int n;
  while (~scanf("%d", &n)) {
    mp.clear();
    ms.clear();
    mm.clear();
    string s;
    string a, b;
    int x, y;
    for (int i = 0; i < n; i++) {
      cin >> s;
      mp[s] = 0;
      ms[s] = 0;
      mm[s] = 0;
    }
    for (int i = 0; i < (n * (n - 1)) / 2; i++) {
      cin >> s;
      int pos = s.find('-');
      a = s.substr(0, pos);
      b = s.substr(pos + 1, 222);
      scanf("%d:%d", &x, &y);
      ms[a] += x;
      ms[b] += y;
      mm[a] += y;
      mm[b] += x;
      if (x > y)
        mp[a] += 3;
      else if (x == y) {
        mp[a] += 1;
        mp[b] += 1;
      } else
        mp[b] += 3;
    }
    int cnt = 0;
    for (it = mp.begin(); it != mp.end(); it++) {
      tt[cnt].name = it->first;
      tt[cnt].goal = it->second;
      cnt++;
    }
    cnt = 0;
    for (it = ms.begin(); it != ms.end(); it++) {
      tt[cnt].name = it->first;
      tt[cnt].scored = it->second;
      cnt++;
    }
    cnt = 0;
    for (it = mm.begin(); it != mm.end(); it++) {
      tt[cnt].name = it->first;
      tt[cnt].miss = it->second;
      cnt++;
    }
    sort(tt, tt + cnt, cmp1);
    sort(tt, tt + n / 2, cmp2);
    for (int i = 0; i < n / 2; i++) {
      cout << tt[i].name << endl;
    }
  }
  return 0;
}
