#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-6;
int ROUND(double x) { return (int)(x + 0.5); }
bool ISINT(double x) { return fabs(ROUND(x) - x) <= EPS; }
bool ISEQUAL(double x, double y) {
  return fabs(x - y) <= EPS * max(1.0, max(fabs(x), fabs(y)));
}
double SQSUM(double x, double y) { return x * x + y * y; }
template <class T>
bool INRANGE(T x, T a, T b) {
  return a <= x && x <= b;
}
void split1(const string& str, vector<string>& out) {
  string::size_type st = 0;
  string::size_type next = 0;
  int word_num = 0;
  string tmp = str;
  do {
    next = tmp.find(" ", st);
    string word = tmp.substr(st, next - st);
    if (word.length() >= 1) {
      out.push_back(word);
    }
    st = next + 1;
  } while (next != string::npos);
}
int main() {
  int n;
  scanf("%d ", &n);
  vector<string> team_names;
  for (int i = 0; i < n; i++) {
    char str[256];
    scanf("%s ", str);
    team_names.push_back(string(str));
  }
  map<string, pair<int, pair<int, int> > > mp;
  for (int i = 0; i < n * (n - 1) / 2; i++) {
    char str[256];
    char str2[256];
    scanf("%s %s ", str, str2);
    for (int k = 0; k < 256; k++) {
      if (str[k] == '-' || str[k] == ':') {
        str[k] = ' ';
      }
      if (str2[k] == '-' || str2[k] == ':') {
        str2[k] = ' ';
      }
    }
    vector<string> vs;
    split1(string(str), vs);
    vector<string> vs2;
    split1(string(str2), vs2);
    string team1, team2;
    int goal1, goal2;
    team1 = vs[0];
    team2 = vs[1];
    goal1 = atoi(vs2[0].c_str());
    goal2 = atoi(vs2[1].c_str());
    mp[team1].first += goal1 > goal2 ? 3 : goal1 == goal2 ? 1 : 0;
    mp[team1].second.first += goal1 - goal2;
    mp[team1].second.second += goal1;
    mp[team2].first += goal2 > goal1 ? 3 : goal2 == goal1 ? 1 : 0;
    mp[team2].second.first += goal2 - goal1;
    mp[team2].second.second += goal2;
  }
  map<pair<int, pair<int, int> >, string> inv_mp;
  {
    map<string, pair<int, pair<int, int> > >::iterator it;
    for (it = mp.begin(); it != mp.end(); it++) {
      inv_mp[it->second] = it->first;
    }
  }
  vector<string> winners;
  {
    map<pair<int, pair<int, int> >, string>::reverse_iterator inv_it =
        inv_mp.rbegin();
    for (int i = 0; i < n / 2; inv_it++, i++) {
      winners.push_back(inv_it->second);
    }
  }
  sort(winners.begin(), winners.end());
  for (int i = 0; i < ((int)winners.size()); i++) {
    printf("%s\n", winners[i].c_str());
  }
  return 0;
}
