#include <bits/stdc++.h>
using namespace std;
string s[4];
string str1, str2, str3;
int score[4];
int num[4];
int s_goals[4], m_goals[4];
int ts_goals[4], tm_goals[4];
int minnum;
int ans_x, ans_y;
map<string, int> m;
int judge(int tmp_score[]) {
  int t[4], rank[4], vis[4];
  memcpy(t, tmp_score, sizeof(t));
  memset(rank, 0, sizeof(rank));
  memset(vis, 0, sizeof(vis));
  sort(t, t + 4);
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (t[i] == tmp_score[j] && !vis[j]) {
        rank[i] = j;
        vis[j] = 1;
        break;
      }
    }
  }
  int r;
  for (int i = 0; i < 4; i++) {
    if (rank[i] == 3) r = i;
  }
  for (int i = 0; i < 4; i++) {
    if (i != r && t[i] == t[r]) {
      if ((ts_goals[3] - tm_goals[3]) >
          (ts_goals[rank[i]] - tm_goals[rank[i]])) {
        if (i > r) {
          swap(rank[i], rank[r]);
          r = i;
        }
      }
      if ((ts_goals[3] - tm_goals[3]) ==
          (ts_goals[rank[i]] - tm_goals[rank[i]])) {
        if (ts_goals[3] > ts_goals[rank[i]]) {
          if (i > r) {
            swap(rank[i], rank[r]);
            r = i;
          }
        }
        if (ts_goals[3] == ts_goals[rank[i]]) {
          if (s[3] < s[rank[i]]) {
            if (i > r) {
              swap(rank[i], rank[r]);
              r = i;
            }
          }
          if (s[3] > s[rank[i]]) {
            if (i < r) {
              swap(rank[i], rank[r]);
              r = i;
            }
          }
        }
        if (ts_goals[3] < ts_goals[rank[i]]) {
          if (i < r) {
            swap(rank[i], rank[r]);
            r = i;
          }
        }
      }
      if ((ts_goals[3] - tm_goals[3]) <
          (ts_goals[rank[i]] - tm_goals[rank[i]])) {
        if (i < r) {
          swap(rank[i], rank[r]);
          r = i;
        }
      }
    }
  }
  if (r >= 2) return 1;
  return 0;
}
void solve() {
  int i, j, x, y;
  int k;
  for (i = 0; i < 4; i++) {
    if (i != 3 && num[i] != 3) k = i;
  }
  int tmp_score[4];
  for (i = 0; i <= 100; i++) {
    for (j = 0; j <= 100; j++) {
      if (i <= j) continue;
      x = i;
      y = j;
      memcpy(tmp_score, score, sizeof(tmp_score));
      memcpy(ts_goals, s_goals, sizeof(s_goals));
      memcpy(tm_goals, m_goals, sizeof(m_goals));
      ts_goals[3] += i;
      tm_goals[3] += j;
      ts_goals[k] += j;
      tm_goals[k] += i;
      if (x == y) {
        tmp_score[3]++;
        tmp_score[k]++;
      }
      if (x > y) tmp_score[3] += 3;
      if (x < y) tmp_score[k] += 3;
      if (judge(tmp_score)) {
        if (minnum > i - j) {
          ans_x = i;
          ans_y = j;
          minnum = i - j;
        }
      }
    }
  }
}
int main() {
  int i, x, y, c1, c2;
  while (cin >> str1) {
    m.clear();
    for (i = 0; i < 3; i++) s[i] = "";
    s[3] = "BERLAND";
    for (int k = 0; k < 5; k++) {
      if (k > 0)
        cin >> str1 >> str2 >> str3;
      else
        cin >> str2 >> str3;
      if (str1 == s[3]) c1 = 3;
      if (str2 == s[3]) c2 = 3;
      if (str1 != s[3]) {
        for (i = 0; i < 3; i++) {
          if (s[i] == str1) {
            c1 = i;
            break;
          }
        }
        if (i == 3) {
          for (i = 0; i < 3; i++) {
            if (s[i] == "") {
              s[i] = str1;
              c1 = i;
              break;
            }
          }
        }
      }
      if (str2 != s[3]) {
        for (i = 0; i < 3; i++) {
          if (s[i] == str2) {
            c2 = i;
            break;
          }
        }
        if (i == 3) {
          for (i = 0; i < 3; i++) {
            if (s[i] == "") {
              s[i] = str2;
              c2 = i;
              break;
            }
          }
        }
      }
      x = str3[0] - '0';
      y = str3[2] - '0';
      num[c1]++;
      num[c2]++;
      s_goals[c1] += x;
      m_goals[c1] += y;
      s_goals[c2] += y;
      m_goals[c2] += x;
      if (x == y) {
        score[c1]++;
        score[c2]++;
      }
      if (x > y) score[c1] += 3;
      if (x < y) score[c2] += 3;
    }
    minnum = 999999999;
    solve();
    if (minnum != 999999999)
      printf("%d:%d\n", ans_x, ans_y);
    else
      printf("IMPOSSIBLE\n");
    memset(score, 0, sizeof(score));
    memset(num, 0, sizeof(num));
    memset(s_goals, 0, sizeof(s_goals));
    memset(m_goals, 0, sizeof(m_goals));
  }
  return 0;
}
