#include <bits/stdc++.h>
using namespace std;
char inp1[55], inp2[55];
map<string, int> M, S, T;
int main() {
  int n;
  cin >> n;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    M[s] = 0;
    S[s] = 0;
    T[s] = 0;
  }
  string a, b;
  int x, y;
  int lim = (n * (n - 1)) / 2;
  for (int i = 0; i < lim; i++) {
    scanf(" %[^-]-%s ", inp1, inp2);
    a = string(inp1);
    b = string(inp2);
    scanf(" %d:%d ", &x, &y);
    if (x > y) {
      M[a] += 3;
    } else if (x == y) {
      M[a] += 1;
      M[b] += 1;
    } else {
      M[b] += 3;
    }
    T[a] += x;
    T[b] += y;
    S[a] += x;
    S[a] -= y;
    S[b] -= x;
    S[b] += y;
  }
  vector<pair<int, pair<int, pair<int, string> > > > V;
  V.resize(n);
  int j = 0;
  for (map<string, int>::iterator it = M.begin(); it != M.end(); it++) {
    V[j] = make_pair(it->second, make_pair(S[it->first],
                                           make_pair(T[it->first], it->first)));
    j++;
  }
  sort(V.begin(), V.end());
  reverse(V.begin(), V.end());
  vector<string> v;
  for (int i = 0; i < n / 2; i++) {
    v.push_back(V[i].second.second.second);
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << endl;
  }
  return 0;
}
