#include <bits/stdc++.h>
using namespace std;
struct node {
  string s;
  int sum;
  int cnt1, cnt2;
} a[55];
map<string, int> mp;
int n;
inline string get() {
  getchar();
  string ans = "";
  char ch = getchar();
  while (ch != '-') {
    ans = ans + ch;
    ch = getchar();
  }
  return ans;
}
bool cmp(node x, node y) {
  if (x.sum == y.sum)
    if (x.cnt1 == y.cnt1)
      if (x.cnt2 == y.cnt2)
        return x.s < y.s;
      else
        return x.cnt2 > y.cnt2;
    else
      return x.cnt1 > y.cnt1;
  return x.sum > y.sum;
}
bool cmp1(node x, node y) { return x.s < y.s; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) cin >> a[i].s, mp[a[i].s] = i;
  for (int i = 1; i <= n * (n - 1) / 2; i++) {
    string s1, s2;
    s1 = get();
    cin >> s2;
    int sum1, sum2;
    scanf("%d:%d", &sum1, &sum2);
    if (sum1 == sum2)
      a[mp[s1]].sum++, a[mp[s2]].sum++, a[mp[s1]].cnt2 += sum1,
          a[mp[s2]].cnt2 += sum2;
    else if (sum1 > sum2)
      a[mp[s1]].sum += 3, a[mp[s1]].cnt2 += sum1, a[mp[s2]].cnt2 += sum2,
          a[mp[s1]].cnt1 += sum1 - sum2, a[mp[s2]].cnt1 += sum2 - sum1;
    else
      a[mp[s2]].sum += 3, a[mp[s1]].cnt2 += sum1, a[mp[s2]].cnt2 += sum2,
          a[mp[s1]].cnt1 += sum1 - sum2, a[mp[s2]].cnt1 += sum2 - sum1;
  }
  sort(a + 1, a + n + 1, cmp);
  sort(a + 1, a + n / 2 + 1, cmp1);
  for (int i = 1; i <= n / 2; i++) cout << a[i].s << endl;
  return 0;
}
