#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> teams(n);
  map<string, int> index;
  string tmp;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    teams[i] = tmp;
    index[tmp] = i;
  }
  getline(cin, tmp);
  vector<int> first(n), second(n), third(n);
  int m = n * (n - 1) / 2;
  for (int i = 0; i < m; i++) {
    char name1[32], name2[32];
    int s1, s2;
    scanf(" %[^-]-%s %d:%d", name1, name2, &s1, &s2);
    if (s1 > s2) first[index[name1]] += 3;
    if (s1 == s2) first[index[name1]] += 1, first[index[name2]] += 1;
    if (s2 > s1) first[index[name2]] += 3;
    second[index[name1]] += s1 - s2;
    second[index[name2]] += s2 - s1;
    third[index[name1]] += s1;
    third[index[name2]] += s2;
  }
  vector<pair<int, pair<int, pair<int, string> > > > score;
  for (int i = 0; i < n; i++)
    score.push_back(make_pair(
        first[i], make_pair(second[i], make_pair(third[i], teams[i]))));
  sort(score.rbegin(), score.rend());
  set<string> out;
  int i = 0;
  while (out.size() < n / 2) out.insert(score[i++].second.second.second);
  vector<string> res(out.begin(), out.end());
  for (int i = 0; i < n / 2; i++) cout << res[i] << endl;
}
