#include <bits/stdc++.h>
using namespace std;
char teams[60][60];
map<string, int> msi;
char inp[120];
char A[120], B[120];
int I[60];
int S[60];
int M[60];
int P[60];
bool cmp(const int &a, const int &b) {
  if (P[a] != P[b]) return P[a] > P[b];
  if (S[a] - M[a] != S[b] - M[b]) return S[a] - M[a] > S[b] - M[b];
  return S[a] > S[b];
}
vector<string> aar;
int main() {
  int n;
  gets(inp);
  n = atoi(inp);
  for (int i = 0; i < n; i++) {
    gets(teams[i]);
    msi[string(teams[i])] = i;
    I[i] = i;
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      int f1 = 0, f2 = 0;
      gets(inp);
      for (int t = 0; t < strlen(inp); t++)
        if (inp[t] == '-') inp[t] = ' ';
      sscanf(inp, "%s %s", A, B);
      int idx = 0;
      while (inp[idx] < '0' || inp[idx] > '9') idx++;
      sscanf(inp + idx, "%d:%d", &f1, &f2);
      if (f1 > f2)
        P[msi[string(A)]] += 3;
      else if (f1 == f2) {
        P[msi[string(A)]]++;
        P[msi[string(B)]]++;
      } else
        P[msi[string(B)]] += 3;
      S[msi[string(A)]] += f1;
      M[msi[string(A)]] += f2;
      S[msi[string(B)]] += f2;
      M[msi[string(B)]] += f1;
    }
  }
  sort(I, I + n, cmp);
  for (int i = 0; i < n / 2; i++) {
    aar.push_back(string(teams[I[i]]));
  }
  sort(aar.begin(), aar.end());
  for (int i = 0; i < n / 2; i++) cout << aar[i] << endl;
  return 0;
}
