#include <bits/stdc++.h>
using namespace std;
map<string, int> names;
string nameinv[1000];
int points[1000];
int scoredgoals[1000];
int missedgoals[1000];
pair<string, string> getteams(char *IN) {
  string a = "";
  string b = "";
  bool left = 0;
  for (int i = 0;; i++) {
    if (IN[i] == '\0') break;
    if (IN[i] == '-') {
      left = 1;
      continue;
    }
    if (!left)
      a.push_back(IN[i]);
    else
      b.push_back(IN[i]);
  }
  return make_pair(a, b);
}
bool compare(pair<int, pair<int, int> > a, pair<int, pair<int, int> > b) {
  if (a.first > b.first) return 1;
  if (a.first < b.first) return 0;
  if (a.second.first - a.second.second > b.second.first - b.second.second)
    return 1;
  if (a.second.first - a.second.second < b.second.first - b.second.second)
    return 0;
  if (a.second.first > b.second.first) return 1;
  if (a.second.first < b.second.first) return 0;
}
pair<int, int> getscores(char *IN) {
  int sc1 = 0;
  int sc2 = 0;
  bool left = 0;
  for (int i = 0;; i++) {
    if (IN[i] == '\0') break;
    if (IN[i] == ':') {
      left = 1;
      continue;
    }
    if (!left)
      sc1 = sc1 * 10 + IN[i] - '0';
    else
      sc2 = sc2 * 10 + IN[i] - '0';
  }
  return make_pair(sc1, sc2);
}
int main() {
  int N;
  scanf("%d", &N);
  int ct = 0;
  for (int i = 0; i < N; i++) {
    points[i] = 0;
    scoredgoals[i] = 0;
    missedgoals[i] = 0;
    char name[100];
    scanf("%s", &name);
    names[name] = ct;
    nameinv[ct] = name;
    ct++;
  }
  for (int m = 0; m < (N * (N - 1)) / 2; m++) {
    char match[1000];
    char matchscore[1000];
    scanf("%s", &match);
    scanf("%s", &matchscore);
    pair<string, string> pairteam = getteams(match);
    pair<int, int> pairscore = getscores(matchscore);
    int sc1 = pairscore.first;
    int sc2 = pairscore.second;
    if (sc1 > sc2) {
      points[names[pairteam.first]] += 3;
    }
    if (sc1 == sc2) {
      points[names[pairteam.first]] += 1;
      points[names[pairteam.second]] += 1;
    }
    if (sc1 < sc2) {
      points[names[pairteam.second]] += 3;
    }
    scoredgoals[names[pairteam.first]] += sc1;
    missedgoals[names[pairteam.first]] += sc2;
    scoredgoals[names[pairteam.second]] += sc2;
    missedgoals[names[pairteam.second]] += sc1;
  }
  bool occ[100];
  for (int i = 0; i < 100; i++) occ[i] = 0;
  vector<string> finalists;
  for (int i = 0; i < N / 2; i++) {
    int jopt = -1;
    pair<int, pair<int, int> > maxscore = make_pair(-1, make_pair(-1, -1));
    for (int j = 0; j < N; j++) {
      pair<int, pair<int, int> > cand =
          make_pair(points[j], make_pair(scoredgoals[j], missedgoals[j]));
      if (compare(cand, maxscore) && !occ[j]) {
        maxscore = cand;
        jopt = j;
      }
    }
    finalists.push_back(nameinv[jopt]);
    occ[jopt] = 1;
  }
  sort(finalists.begin(), finalists.end());
  for (int i = 0; i < finalists.size(); i++) cout << finalists[i] << endl;
}
