#include <bits/stdc++.h>
using namespace std;
typedef struct {
  int punts, scored, missed;
  string str;
} ST;
bool sortf(ST a, ST b) {
  if (a.punts != b.punts) return a.punts > b.punts;
  int da = a.scored - a.missed;
  int db = b.scored - b.missed;
  if (da != db) return da > db;
  return a.scored > b.scored;
}
int main() {
  int n;
  cin >> n;
  ST zero;
  zero.punts = zero.scored = zero.missed = 0;
  vector<ST> v(n, zero);
  map<string, int> mp;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    mp[s] = i;
    v[i].str = s;
  }
  for (int i = 0; i < n * (n - 1) / 2; ++i) {
    string a, b;
    char c;
    while (cin >> c and c != '-') a += c;
    cin >> b;
    int na, nb;
    cin >> na >> c >> nb;
    int ma = mp[a];
    int mb = mp[b];
    v[ma].scored += na;
    v[ma].missed += nb;
    v[mb].scored += nb;
    v[mb].missed += na;
    if (na < nb)
      v[mb].punts += 3;
    else if (na > nb)
      v[ma].punts += 3;
    else {
      v[ma].punts += 1;
      v[mb].punts += 1;
    }
  }
  sort(v.begin(), v.end(), sortf);
  vector<string> u(n / 2);
  for (int i = 0; i < n / 2; ++i) u[i] = v[i].str;
  sort(u.begin(), u.end());
  for (int i = 0; i < n / 2; ++i) cout << u[i] << endl;
}
