#include <bits/stdc++.h>
using namespace std;
string b[51];
map<string, int> mp;
struct A {
  int d, w, l, diff;
} a[255];
bool cmp(A x, A y) {
  if (x.w != y.w) return x.w > y.w;
  if (x.diff != y.diff) return x.diff > y.diff;
  return x.d > y.d;
}
int main() {
  int i, j, k, n, m, z, c, x;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> b[i];
    mp[b[i]] = i;
  }
  m = n * (n - 1) / 2;
  getchar();
  for (i = 0; i < m; i++) {
    c = 0;
    int l = 0, r = 0;
    string ss, v, s;
    getline(cin, ss);
    for (j = 0; j < ss.size(); j++) {
      char ch = ss[j];
      if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')) {
        if (c == 0)
          v += ch;
        else {
          s += ch;
        }
      }
      if (ch == '-') c = 1;
      if (ch >= '0' && ch <= '9') {
        if (c == 1) {
          l = l * 10 + (ch - 48);
        } else {
          r = r * 10 + (ch - 48);
        }
      }
      if (ch == ':') c++;
    }
    if (l > r) {
      a[mp[v]].w += 3;
      a[mp[v]].d += l;
      a[mp[s]].d += r;
      a[mp[v]].l = mp[v] + 1;
    } else if (r > l) {
      a[mp[s]].w += 3;
      a[mp[v]].d += l;
      a[mp[s]].d += r;
      a[mp[s]].l = mp[s] + 1;
    } else {
      a[mp[v]].d += l;
      a[mp[s]].d += r;
      int e = mp[s], f = mp[v];
      a[f].w++;
      a[e].w++;
      a[f].l = f + 1;
      a[e].l = e + 1;
    }
    a[mp[v]].diff += (l - r);
    a[mp[s]].diff += (r - l);
  }
  sort(a, a + 255, cmp);
  n = n / 2;
  string ab[255];
  c = 0;
  for (i = 0; i <= 255 && n; i++) {
    if (a[i].l) {
      int ch = a[i].l;
      ab[c++] = b[ch - 1];
      n--;
    }
  }
  sort(ab, ab + c);
  for (i = 0; i < c; i++) cout << ab[i] << endl;
}
