#include <bits/stdc++.h>
using namespace std;
struct st {
  char name[33];
  int point;
  int score, mis;
} s[55];
int n;
void inc(char *a, int n1, int n2) {
  if (strlen(a) > 33) {
    int a, b = 0;
    a = a / b;
  }
  for (int i = 0; i < n; i++)
    if (strcmp(a, s[i].name) == 0) {
      if (n1 > n2)
        s[i].point += 3;
      else if (n1 == n2)
        s[i].point++;
      s[i].score += n1;
      s[i].mis += n2;
    }
}
bool cmp(st l, st r) {
  if (l.point != r.point) return l.point > r.point;
  if ((l.score - l.mis) != (r.score - r.mis))
    return (l.score - l.mis) > (r.score - r.mis);
  return l.score > r.score;
}
string str(char *s) {
  int l = strlen(s);
  if (l > 33) {
    int a, b = 0;
    a = a / b;
  }
  string r;
  for (int i = 0; i < l; i++) r.push_back(s[i]);
  return r;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i].name;
    s[i].point = 0;
    s[i].score = s[i].mis = 0;
  }
  int m = n * (n - 1) / 2;
  char a[99], b[999], c[99];
  int n1, n2;
  for (int i = 0; i < m; i++) {
    scanf("%s", c);
    int sz = 0;
    int len = strlen(c);
    while (c[sz] != '-') {
      a[sz] = c[sz];
      sz++;
    }
    a[sz] = '\0';
    int j = 0;
    sz++;
    while (sz < len && c[sz] != '\0' && c[sz] != '\r') {
      b[j++] = c[sz];
      sz++;
    }
    b[j] = '\0';
    scanf("%s", c);
    sz = 0;
    n1 = n2 = 0;
    len = strlen(c);
    while (c[sz] != ':') {
      n1 = n1 * 10 + c[sz] - '0';
      sz++;
    }
    sz++;
    while (sz < len && c[sz] != '\0' && c[sz] != '\r') {
      n2 = n2 * 10 + c[sz] - '0';
      sz++;
    }
    inc(a, n1, n2);
    inc(b, n2, n1);
  }
  sort(s, s + n, cmp);
  vector<string> v;
  for (int i = 0; i < n / 2; i++) {
    v.push_back(str(s[i].name));
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) cout << v[i] << endl;
}
