#include <bits/stdc++.h>
using namespace std;
string str[100];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int t, i, j, k, x, y, z, n, m, ln, sq, q, l, r, up, in, op = 1;
  int ans = 0, sum = 0, ct = 0, ok = 0, mx = -INT_MAX, mn = INT_MAX,
      hi = INT_MAX, lo = 0, mid;
  string s, st;
  map<string, int> mp, mpp, mppp;
  cin >> n;
  for (i = 0; i < n; i++) cin >> str[i];
  m = (n * (n - 1)) / 2;
  while (m--) {
    cin >> s >> st;
    string a, b;
    ok = 1;
    for (i = 0; i < s.size(); i++) {
      if (s[i] == '-') {
        ok = 0;
        continue;
      }
      if (ok)
        a += s[i];
      else
        b += s[i];
    }
    x = 0;
    for (i = 0; i < st.size(); i++) {
      if (st[i] == ':') break;
      x *= 10;
      x += (st[i] - '0');
    }
    y = 0;
    for (i++; i < st.size(); i++) {
      y *= 10;
      y += (st[i] - '0');
    }
    if (x == y) {
      mp[a]++;
      mp[b]++;
    } else if (x > y) {
      mp[a] += 3;
    } else
      mp[b] += 3;
    mpp[a] += (x - y);
    mpp[b] += (y - x);
    mppp[a] += x;
    mppp[b] += y;
  }
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      if (mp[str[i]] < mp[str[j]])
        swap(str[i], str[j]);
      else if (mp[str[i]] == mp[str[j]]) {
        if (mpp[str[i]] < mpp[str[j]])
          swap(str[i], str[j]);
        else if (mpp[str[i]] == mpp[str[j]]) {
          if (mppp[str[i]] < mppp[str[j]]) swap(str[i], str[j]);
        }
      }
    }
  }
  sort(str, str + (n / 2));
  for (i = 0; i < n / 2; i++) cout << str[i] << "\n";
}
