#include <bits/stdc++.h>
using namespace std;
map<string, int> mp;
int search(char *str, char x) {
  for (int i = 0; str[i]; i++)
    if (str[i] == x) return i;
  return -1;
}
struct po {
  int points, gc, cnt;
  char na[33];
} p[55];
bool cmp1(po a, po b) {
  if (a.points == b.points) {
    if (a.cnt == b.cnt) return a.gc > b.gc;
    return a.cnt > b.cnt;
  }
  return a.points > b.points;
}
bool cmp2(po a, po b) { return strcmp(a.na, b.na) < 0; }
int main() {
  int n, l, n1, n2, id1, id2;
  char str[66], sp[10];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", str);
    mp[str] = i;
    strcpy(p[i].na, str);
  }
  for (int i = 0; i < (n - 1) * n / 2; i++) {
    scanf("%s%s", str, sp);
    sscanf(sp, "%d:%d", &n1, &n2);
    l = search(str, '-');
    str[l] = 0;
    id1 = mp[str];
    id2 = mp[str + l + 1];
    if (n1 != n2) {
      if (n1 > n2)
        p[id1].points += 3;
      else
        p[id2].points += 3;
      p[id1].cnt += n1 - n2;
      p[id2].cnt += n2 - n1;
    } else {
      p[id1].points++;
      p[id2].points++;
    }
    p[id1].gc += n1;
    p[id2].gc += n2;
  }
  sort(p, p + n, cmp1);
  for (int i = n / 2; i <= n; i++) {
    if (p[i].points < p[i - 1].points || p[i].cnt < p[i - 1].cnt ||
        p[i].gc < p[i - 1].gc || i == n) {
      sort(p, p + i, cmp2);
      break;
    }
  }
  for (int i = 0; i < n / 2; i++) puts(p[i].na);
  return 0;
}
