#include <bits/stdc++.h>
using namespace std;
struct that {
  string s;
  int sc, z, p;
  void set(int SC, int Z, int P, string S) {
    sc = SC;
    z = Z;
    p = P;
    s = S;
  }
} t[5];
int who, cur, p[8], z[8], sc[8], need, m[5];
string a, b, c, name[8];
bool myCmp(that a, that b) {
  return a.sc > b.sc || (a.sc == b.sc && a.z - a.p > b.z - b.p) ||
         (a.sc == b.sc && a.z - a.p == b.z - b.p && a.z > b.z) ||
         (a.sc == b.sc && a.z - a.p == b.z - b.p && a.z == b.z && a.s < b.s);
}
void rend(string s) {
  bool ok = 0;
  for (int i = 0; i < cur; i++) ok |= name[i] == s;
  if (ok) return;
  name[cur++] = s;
}
void del(string s, int zz, int pp) {
  int id = 0;
  for (int i = 0; i < cur; i++)
    if (name[i] == s) {
      id = i;
      break;
    }
  if (zz > pp)
    sc[id] += 3;
  else
    sc[id] += zz == pp;
  z[id] += zz;
  p[id] += pp;
  m[id]++;
}
inline bool get(int x, int y) {
  for (int i = 0; i < cur; i++) t[i].set(sc[i], z[i], p[i], name[i]);
  t[need].sc += 3;
  t[need].z += x;
  t[need].p += y;
  t[who].z += y;
  t[who].p += x;
  sort(t, t + 5, myCmp);
  return t[0].s == "BERLAND" || t[1].s == "BERLAND";
}
int main() {
  for (int i = 0; i < 5; i++) {
    cin >> a >> b >> c;
    int ff = c[0] - 48;
    int ss = c[2] - 48;
    rend(a);
    rend(b);
    del(a, ff, ss);
    del(b, ss, ff);
  }
  for (int i = 0; i < cur; i++)
    if (name[i] == "BERLAND") need = i;
  for (int i = 0; i < cur; i++)
    if (i != need && m[i] == 2) who = i;
  int X = 1505, Y = 1505;
  for (int x = 1; x < 125; x++)
    for (int y = 0; y < x; y++) {
      if (get(x, y)) {
        if (X == 1505 || (X - Y > x - y) || (X - Y == x - y && Y > y)) {
          X = x;
          Y = y;
        }
      }
    }
  if (X == 1505)
    puts("IMPOSSIBLE");
  else
    printf("%d:%d\n", X, Y);
  return 0;
}
