#include <bits/stdc++.h>
using namespace std;
const int MAXN = 50 + 10;
int n;
string names[MAXN];
map<string, int> Name;
struct Node {
  int a, b, c;
  int x, y, z;
  int num;
  int id;
} team[MAXN];
string ans[MAXN];
int trans(string str) {
  int len = str.size();
  int sum = 0;
  for (int i = 0; i < len; i++) sum = sum * 10 + str[i] - '0';
  return sum;
}
bool cmp(Node teamA, Node teamB) {
  return (teamA.num > teamB.num) ||
         (teamA.num == teamB.num && teamA.c > teamB.c) ||
         (teamA.num == teamB.num && teamA.c == teamB.c && teamA.a > teamB.a);
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    string str;
    cin >> str;
    names[i] = str;
    Name[str] = i;
  }
  for (int i = 1; i <= n * (n - 1) / 2; i++) {
    string str;
    cin >> str;
    int len = str.size();
    int pos = str.find("-");
    string lstr = str.substr(0, pos);
    string rstr = str.substr(pos + 1, len - pos - 1);
    cin >> str;
    len = str.size();
    pos = str.find(":");
    int num1 = trans(str.substr(0, pos));
    int num2 = trans(str.substr(pos + 1, len - pos - 1));
    team[Name[lstr]].a += num1;
    team[Name[rstr]].b += num1;
    team[Name[rstr]].a += num2;
    team[Name[lstr]].b += num2;
    if (num1 > num2)
      team[Name[lstr]].x++, team[Name[rstr]].y++;
    else if (num1 == num2)
      team[Name[lstr]].z++, team[Name[rstr]].z++;
    else
      team[Name[rstr]].x++, team[Name[lstr]].y++;
  }
  for (int i = 1; i <= n; i++) {
    team[i].id = i;
    team[i].c = team[i].a - team[i].b;
    team[i].num = team[i].x * 3 + team[i].z;
  }
  sort(team + 1, team + n + 1, cmp);
  for (int i = 1; i <= n / 2; i++) ans[i] = names[team[i].id];
  sort(ans + 1, ans + n / 2 + 1);
  for (int i = 1; i <= n / 2; i++) cout << ans[i] << endl;
  return 0;
}
