#include <bits/stdc++.h>
using namespace std;
const int INF = 20050226;
char s[4][30], p;
struct team {
  int goal, score, num, win;
  team() { goal = score = num = win = 0; }
  char name[30];
};
team t[4];
int game[4];
char s1[30], s2[30];
bool flag;
int t1, t2, p1, p2;
bool cmp(team a, team b) {
  if (a.score == b.score) {
    if (a.win == b.win) {
      if (a.goal == b.goal) {
        return (strcmp(a.name, b.name) < 0);
      }
      return a.goal > b.goal;
    }
    return a.win > b.win;
  }
  return a.score > b.score;
}
bool cmp1(team a, team b) { return a.num < b.num; }
int getl(char *str) {
  for (int i = 0; i < p; i++)
    if (!strcmp(t[i].name, str)) return i;
  strcpy(t[p++].name, str);
  t[p - 1].num = p - 1;
  return p - 1;
}
int main() {
  for (int i = 0; i < 5; i++) {
    cin >> s1 >> s2;
    flag = 0;
    cin >> t1;
    cin.get();
    cin >> t2;
    p1 = getl(s1);
    p2 = getl(s2);
    t[p1].goal += t1;
    t[p2].goal += t2;
    if (t1 > t2)
      t[p1].score += 3;
    else if (t1 == t2) {
      t[p1].score++;
      t[p2].score++;
    } else
      t[p2].score += 3;
    t[p1].win += t1 - t2;
    t[p2].win += t2 - t1;
    game[p1]++;
    game[p2]++;
  }
  char Me[] = "BERLAND";
  int me = getl(Me);
  int he;
  for (int i = 0; i < 4; i++)
    if (game[i] != 3 and i != me) he = i;
  int w1 = t[me].win, w2 = t[he].win, g1 = t[me].goal, g2 = t[he].goal;
  t[me].score += 3;
  for (int i1 = 1; i1 <= 20; i1++) {
    for (int j1 = 0; j1 < 20; j1++) {
      int i = i1 + j1;
      int j = j1;
      sort(t, t + 4, cmp1);
      t[me].goal = g1 + i;
      t[he].goal = g2 + j;
      t[me].win = w1 + i - j;
      t[he].win = w2 + j - i;
      sort(t, t + 4, cmp);
      int tmp;
      for (int k = 0; k < 4; k++) {
        if (t[k].num == me) tmp = k;
      }
      if (tmp <= 1) {
        cout << i << ':' << j << endl;
        return 0;
      }
    }
  }
  cout << "IMPOSSIBLE" << endl;
  return 0;
}
