#include <bits/stdc++.h>
using namespace std;
inline void boost() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
}
map<string, int> pt, sc, ms;
vector<string> fin, ans;
string s[55], q, t1, t2;
int n, num1, num2;
void get() {
  bool ok = 0;
  int it = 0;
  while (q[it] != ' ') {
    if (q[it] == '-')
      ok = 1;
    else if (!ok)
      t1 += q[it];
    else
      t2 += q[it];
    it++;
  }
  it++, ok = 0;
  while (it < (int)q.size()) {
    if (q[it] == ':')
      ok = 1;
    else if (!ok)
      num1 *= 10, num1 += (q[it] - '0');
    else
      num2 *= 10, num2 += (q[it] - '0');
    it++;
  }
}
bool cmp(string &a, string &b) {
  if (pt[a] != pt[b]) return pt[a] > pt[b];
  if ((sc[a] - ms[a]) != (sc[b] - ms[b]))
    return (sc[a] - ms[a]) > (sc[b] - ms[b]);
  return sc[a] > sc[b];
}
int main() {
  boost();
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    fin.push_back(s[i]);
  }
  getline(cin, q);
  for (int i = 1; i <= n * (n - 1) / 2; i++) {
    t1 = t2 = "";
    num1 = num2 = 0;
    getline(cin, q);
    get();
    sc[t1] += num1, ms[t1] += num2;
    sc[t2] += num2, ms[t2] += num1;
    if (num1 > num2)
      pt[t1] += 3;
    else if (num2 > num1)
      pt[t2] += 3;
    else
      pt[t1]++, pt[t2]++;
  }
  sort(fin.begin(), fin.end(), &cmp);
  for (int i = 0; i < n / 2; i++) ans.push_back(fin[i]);
  sort(ans.begin(), ans.end());
  for (auto team : ans) cout << team << '\n';
  return 0;
}
