#include <bits/stdc++.h>
using namespace std;
const int MAXN = 50;
int n, scores[MAXN], goals_in[MAXN], goals_out[MAXN];
string names[MAXN], pass[MAXN];
pair<pair<int, int>, pair<int, string> > table[MAXN];
void read_data() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> names[i];
  for (int i = 0; i < (n * n - n) / 2; ++i) {
    int t1, t2, s1, s2;
    string tmp;
    cin >> tmp;
    t1 = find(&names[0], &names[n], tmp.substr(0, tmp.find('-'))) - &names[0];
    t2 = find(&names[0], &names[n], tmp.substr(tmp.find('-') + 1)) - &names[0];
    cin >> tmp;
    s1 = atoi(tmp.substr(0, tmp.find(':')).c_str());
    s2 = atoi(tmp.substr(tmp.find(':') + 1).c_str());
    if (s1 > s2)
      scores[t1] += 3;
    else if (s2 > s1)
      scores[t2] += 3;
    else {
      scores[t1] += 1;
      scores[t2] += 1;
    }
    goals_out[t1] += s1;
    goals_out[t2] += s2;
    goals_in[t1] += s2;
    goals_in[t2] += s1;
  }
}
void solve() {
  for (int i = 0; i < n; ++i) {
    table[i].first.first = scores[i];
    table[i].first.second = goals_out[i] - goals_in[i];
    table[i].second.first = goals_out[i];
    table[i].second.second = names[i];
  }
  sort(&table[0], &table[n],
       greater<pair<pair<int, int>, pair<int, string> > >());
  for (int i = 0; i < n / 2; ++i) pass[i] = table[i].second.second;
  sort(&pass[0], &pass[n / 2]);
  for (int i = 0; i < n / 2; ++i) cout << pass[i] << endl;
}
int main() {
  read_data();
  solve();
  return 0;
}
