#include <bits/stdc++.h>
using namespace std;
struct team {
  string name;
  int score;
  int gfor, gagainst;
  int gdiff() const { return gfor - gagainst; }
} T[51];
map<string, int> mp;
bool Less1(const team &a, const team &b) {
  if (a.score != b.score) return a.score > b.score;
  if (a.gdiff() != b.gdiff()) return a.gdiff() > b.gdiff();
  return a.gfor > b.gfor;
}
bool Less2(const team &a, const team &b) { return a.name < b.name; }
void Add(team &ta, team &tb, int a, int b) {
  ta.gfor += a;
  ta.gagainst += b;
  tb.gfor += b;
  tb.gagainst += a;
  if (a > b)
    ta.score += 3;
  else if (a < b)
    tb.score += 3;
  else {
    ta.score++;
    tb.score++;
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> T[i].name;
    mp[T[i].name] = i;
  }
  cin.ignore();
  int pos, a, b;
  string s, sa, sb;
  istringstream iss;
  for (int i = 0; i < n * (n - 1) / 2; i++) {
    getline(cin, s);
    pos = s.find('-');
    s[pos] = ' ';
    pos = s.find(':');
    s[pos] = ' ';
    iss.str(s);
    iss.seekg(0, iss.beg);
    iss >> sa >> sb >> a >> b;
    Add(T[mp[sa]], T[mp[sb]], a, b);
  }
  sort(T, T + n, Less1);
  sort(T, T + n / 2, Less2);
  for (int i = 0; i < n / 2; i++) cout << T[i].name << endl;
}
