#include <bits/stdc++.h>
using namespace std;
struct P {
  int id;
  string name;
  int point;
  int gain;
  int missed;
} p[55];
bool cmp(P a, P b) {
  if (a.point > b.point) {
    return 1;
  } else if (a.point < b.point) {
    return 0;
  } else {
    int aa = a.gain - a.missed;
    int bb = b.gain - b.missed;
    if (aa > bb) {
      return 1;
    } else if (aa < bb) {
      return 0;
    } else {
      if (a.gain > b.gain) {
        return 1;
      } else if (a.gain < b.gain) {
        return 0;
      }
    }
  }
  return 0;
}
int main() {
  map<string, int> m;
  string name[55];
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    m[s] = i + 1;
  }
  for (__typeof(m.begin()) i = m.begin(); i != m.end(); i++) {
    p[i->second].name = i->first;
  }
  for (int i = 1; i < n; i++) {
    for (int j = i; j < n; j++) {
      char nn[100];
      int sa, sb;
      scanf("%s %d:%d", nn, &sa, &sb);
      string nnn(nn);
      int idx = 0;
      for (int i = 0; i < nnn.size(); ++i) {
        if (nnn[i] == '-') {
          idx = i;
          break;
        }
      }
      string aaa = nnn.substr(0, idx), bbb = nnn.substr(idx + 1, nnn.size());
      if (sa == sb) {
        p[m[aaa]].point++;
        p[m[bbb]].point++;
        p[m[aaa]].gain += sa;
        p[m[bbb]].gain += sb;
        p[m[aaa]].missed += sb;
        p[m[bbb]].missed += sa;
      }
      if (sa < sb) {
        string t = aaa;
        aaa = bbb;
        bbb = t;
        int tt = sa;
        sa = sb;
        sb = tt;
      }
      if (sa > sb) {
        p[m[aaa]].point += 3;
        p[m[aaa]].gain += sa;
        p[m[bbb]].gain += sb;
        p[m[aaa]].missed += sb;
        p[m[bbb]].missed += sa;
      }
    }
  }
  sort(p + 1, p + 1 + n, cmp);
  vector<string> ans;
  for (int i = 1; i <= n / 2; i++) {
    ans.push_back(p[i].name);
  }
  sort(ans.begin(), ans.end());
  for (int i = 0; i < n / 2; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
