#include <bits/stdc++.h>
using namespace std;
struct node {
  char name[1111];
  int sum1, sum2, s;
} a[55];
bool cmp1(node t1, node t2) {
  if (t1.s > t2.s)
    return true;
  else if (t1.s == t2.s && t1.sum1 - t1.sum2 > t2.sum1 - t2.sum2)
    return true;
  else if (t1.s == t2.s && t1.sum1 - t1.sum2 == t2.sum1 - t2.sum2 &&
           t1.sum1 > t2.sum1)
    return true;
  return false;
}
map<string, int> pos;
vector<string> ans;
char s[111], s1[111], s2[111];
int main() {
  int n, i, j, num1, num2, k;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%s", s);
    strcpy(a[i].name, s);
    pos[a[i].name] = i;
  }
  int m = n * (n - 1) / 2;
  for (i = 1; i <= m; i++) {
    scanf("%s%d:%d", s, &num1, &num2);
    for (j = 0; s[j] != '-'; j++) s1[j] = s[j];
    s1[j] = 0;
    for (j = j + 1, k = 0; j < strlen(s); j++) s2[k++] = s[j];
    s2[k] = 0;
    a[pos[s1]].sum1 += num1;
    a[pos[s1]].sum2 += num2;
    a[pos[s2]].sum1 += num2;
    a[pos[s2]].sum2 += num1;
    if (num1 > num2) {
      a[pos[s1]].s += 3;
    } else if (num1 < num2) {
      a[pos[s2]].s += 3;
    } else {
      a[pos[s1]].s++;
      a[pos[s2]].s++;
    }
  }
  sort(a + 1, a + 1 + n, cmp1);
  for (i = 1; i <= n / 2; i++) {
    ans.push_back(a[i].name);
  }
  sort(ans.begin(), ans.end());
  for (i = 0; i < ans.size(); i++) cout << ans[i] << endl;
  return 0;
}
