#include <bits/stdc++.h>
using namespace std;
template <class T>
int len(const T& c) {
  return (int)c.size();
}
class team {
 public:
  int goal, missed, points, played;
  string name;
  team() {
    goal = missed = points = played = 0;
    name = "";
  }
  bool operator<(const team o1) const {
    if (points != o1.points) return points > o1.points;
    if ((goal - missed) != (o1.goal - o1.missed))
      return (goal - missed) > (o1.goal - o1.missed);
    if (goal != o1.goal) return goal > o1.goal;
    return name < o1.name;
  }
};
int n, cnt;
vector<team> v;
string s;
map<string, int> m;
char ch, o1, o2;
vector<string> vv;
vector<string> split(string s, string x = "-") {
  vector<string> res;
  for (int i(0), _n(len(s)); i < _n; ++i) {
    string a;
    while (i < (int)s.size() && x.find(s[i]) == string::npos) a += s[i++];
    if (!a.empty()) res.push_back((a));
  }
  return res;
}
long long toint(string s) {
  long long r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
vector<string> v2;
int main() {
  cin >> n;
  v.resize(n);
  for (int i(0), _n(n); i < _n; ++i) {
    cin >> s;
    v[i].name = s;
    m[s] = i;
  }
  for (int i(0), _n(n * (n - 1) / 2); i < _n; ++i) {
    cin >> s;
    vv = split(s);
    cin >> s;
    v2 = split(s, ":");
    o1 = toint(v2[0]);
    o2 = toint(v2[1]);
    v[m[vv[0]]].goal += o1;
    v[m[vv[0]]].missed += o2;
    v[m[vv[1]]].goal += o2;
    v[m[vv[1]]].missed += o1;
    if (o1 == o2) {
      v[m[vv[0]]].points += 1;
      v[m[vv[1]]].points += 1;
    }
    if (o1 > o2) {
      v[m[vv[0]]].points += 3;
    }
    if (o1 < o2) {
      v[m[vv[1]]].points += 3;
    }
  }
  vv.clear();
  sort(v.begin(), v.end());
  for (int i(0), _n(n / 2); i < _n; ++i) {
    vv.push_back(v[i].name);
  }
  sort(vv.begin(), vv.end());
  for (int i(0), _n(n / 2); i < _n; ++i) {
    cout << vv[i] << endl;
  }
}
