#include <bits/stdc++.h>
using namespace std;
int n;
pair<string, pair<int, pair<int, int> > > a[55];
vector<string> v;
int find(string s) {
  for (int i = 0; i < n; i++)
    if (a[i].first == s) return i;
  return -1;
}
int conv(string s) {
  stringstream ss;
  ss << s;
  int n;
  ss >> n;
  return n;
}
bool cmp(pair<string, pair<int, pair<int, int> > > a,
         pair<string, pair<int, pair<int, int> > > b) {
  if (a.second.first == b.second.first) {
    if (a.second.second.first - a.second.second.second ==
        b.second.second.first - b.second.second.second)
      return a.second.second.first > b.second.second.first;
    return a.second.second.first - a.second.second.second >
           b.second.second.first - b.second.second.second;
  }
  return a.second.first > b.second.first;
}
int main() {
  int p, t1, t2, g1, g2;
  string t, s;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = make_pair(0, make_pair(0, 0));
  }
  for (int i = 0; i < n * (n - 1) / 2; i++) {
    cin >> t >> s;
    p = t.find('-');
    t1 = find(t.substr(0, p));
    t2 = find(t.substr(p + 1));
    p = s.find(':');
    g1 = conv(s.substr(0, p));
    g2 = conv(s.substr(p + 1));
    a[t1].second.second.first += g1, a[t1].second.second.second += g2;
    a[t2].second.second.first += g2, a[t2].second.second.second += g1;
    if (g1 > g2)
      a[t1].second.first += 3;
    else if (g1 < g2)
      a[t2].second.first += 3;
    else
      a[t1].second.first++, a[t2].second.first++;
  }
  sort(a, a + n, cmp);
  for (int i = 0; i < n / 2; i++) v.push_back(a[i].first);
  sort(v.begin(), v.end());
  for (int i = 0; i < n / 2; i++) cout << v[i] << '\n';
  return 0;
}
