#include <bits/stdc++.h>
using namespace std;
char a[100][100], x[100], y[100];
int n, i, b[100], j, k, l, r[100], z[100];
int main() {
  cin >> n;
  for (i = 0; i < n; ++i) scanf("%s", &a[i]);
  for (i = 0; i < n - 1; ++i) {
    k = i;
    for (j = k + 1; j < n; ++j)
      if (strcmp(a[k], a[j]) > 0) k = j;
    strcpy(x, a[i]);
    strcpy(a[i], a[k]);
    strcpy(a[k], x);
  }
  for (i = 0; i < (n * (n - 1) / 2); ++i) {
    scanf("%s", &x);
    for (k = 0; k < strlen(x); ++k)
      if (x[k] == '-') break;
    for (l = k + 1; l < strlen(x); ++l) y[l - k - 1] = x[l];
    x[k] = 0;
    y[l - k - 1] = 0;
    scanf("%d:%d", &k, &l);
    for (j = 0; j < n; ++j)
      if (!strcmp(a[j], x)) {
        z[j] += k;
        r[j] += k - l;
        if (k > l)
          b[j] += 3;
        else if (k == l)
          b[j] += 1;
      } else if (!strcmp(a[j], y)) {
        z[j] += l;
        r[j] += l - k;
        if (k < l)
          b[j] += 3;
        else if (k == l)
          b[j] += 1;
      }
  }
  for (i = 0; i < n / 2; ++i) {
    k = 0;
    for (j = 0; j < n; ++j)
      if (b[j] > b[k])
        k = j;
      else if (b[j] == b[k])
        if (r[j] > r[k])
          k = j;
        else if (r[k] == r[j] && z[j] > z[k])
          k = j;
    b[k] = -10000;
  }
  for (i = 0; i < n; ++i)
    if (b[i] == -10000) cout << a[i] << endl;
  return 0;
}
