#include <bits/stdc++.h>
using namespace std;
int n, m;
string name[50];
char s[10000];
int p[50];
int res[50], qz[50], qp[50];
map<string, int> all;
bool cmp(int i, int j) {
  return res[i] > res[j] or
         res[i] == res[j] and qz[i] - qp[i] > qz[j] - qp[j] or
         res[i] == res[j] and qz[i] - qp[i] == qz[j] - qp[j] and qz[i] > qz[j];
}
bool cmp2(int i, int j) { return name[i] < name[j]; }
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> name[i];
    all[name[i]] = i;
    p[i] = i;
  }
  gets(s);
  for (int i = 0; i < n * (n - 1) / 2; i++) {
    gets(s);
    for (int j = 0; s[j]; j++) {
      if (s[j] == '-' or s[j] == ':') {
        s[j] = ' ';
      }
    }
    stringstream in(s);
    string a, b;
    int x, y;
    in >> a >> b >> x >> y;
    int A = all[a];
    int B = all[b];
    if (x > y) {
      res[A] += 3;
    } else {
      if (x < y) {
        res[B] += 3;
      }
      if (x == y) {
        res[A]++;
        res[B]++;
      }
    }
    qz[A] += x;
    qp[A] += y;
    qp[B] += x;
    qz[B] += y;
  }
  sort(p, p + n, cmp);
  sort(p, p + n / 2, cmp2);
  for (int i = 0; i < n / 2; i++) {
    cout << name[p[i]] << endl;
  }
  return 0;
}
