#include <bits/stdc++.h>
using namespace std;
struct node {
  string name;
  int score, diff, goal;
} t[100];
bool cmp(node x, node y) {
  if (x.score != y.score) return x.score > y.score;
  if (x.diff != y.diff) return x.diff > y.diff;
  return x.goal > y.goal;
}
bool cmp1(node x, node y) { return x.name < y.name; }
int main() {
  int n;
  map<string, node> m;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    char buff[128];
    scanf("%s", buff);
    node T;
    T.name = string(buff);
    m[T.name] = T;
  }
  for (int i = 0; i < n * (n - 1) / 2; i++) {
    char buff[128];
    int ga, gb;
    scanf("%s %d:%d", buff, &ga, &gb);
    string s(buff);
    int f = s.find("-");
    node &a = m[s.substr(0, f)], &b = m[s.substr(f + 1)];
    a.goal += ga;
    a.diff += ga - gb;
    b.goal += gb;
    b.diff += gb - ga;
    if (ga > gb)
      a.score += 3;
    else if (ga < gb)
      b.score += 3;
    else {
      a.score += 1;
      b.score += 1;
    }
  }
  int ind = 0;
  for (auto it = m.begin(); it != m.end(); it++) t[ind++] = it->second;
  sort(t, t + n, cmp);
  sort(t, t + n / 2, cmp1);
  for (int i = 0; i < n / 2; i++) cout << t[i].name << endl;
}
