#include <bits/stdc++.h>
using namespace std;
struct Tm {
  string name;
  int first, wn, ls, bs;
} T[4];
inline bool cmp(Tm a, Tm b) {
  if (a.first > b.first) return 1;
  if (a.first < b.first) return 0;
  int t1 = a.wn - a.ls, t2 = b.wn - b.ls;
  if (t1 > t2) return 1;
  if (t1 < t2) return 0;
  if (a.wn > b.wn) return 1;
  if (a.wn < b.wn) return 0;
  return a.name < b.name;
}
int main() {
  ios_base::sync_with_stdio(false);
  int i, j, nsz = -1;
  string a, b, c;
  for (i = 0; i < 5; i++) {
    cin >> a >> b >> c;
    int nm1 = -1, nm2 = -1;
    for (j = 0; j < 4; j++) {
      if (T[j].name == a) {
        nm1 = j;
      } else if (T[j].name == b) {
        nm2 = j;
      }
    }
    if (nm1 == -1) {
      nm1 = ++nsz;
      T[nsz].name = a;
    }
    if (nm2 == -1) {
      nm2 = ++nsz;
      T[nsz].name = b;
    }
    int x, y;
    x = c.substr(0, 1)[0] - '0';
    y = c.substr(2, 1)[0] - '0';
    T[nm1].ls += y;
    T[nm2].ls += x;
    T[nm1].wn += x;
    T[nm2].wn += y;
    T[nm1].bs++;
    T[nm2].bs++;
    if (x > y) {
      T[nm1].first += 3;
    } else if (x < y) {
      T[nm2].first += 3;
    } else {
      T[nm1].first++;
      T[nm2].first++;
    }
  }
  sort(T, T + 4, cmp);
  int ws = 0, bt;
  for (i = 0; i < 4; i++) {
    if (T[i].name == "BERLAND")
      ws = i;
    else if (T[i].bs < 3)
      bt = i;
  }
  if (T[ws].first + 3 < T[1].first) {
    cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  int y = 0, ppp = 0, x = -1;
  T[ws].first += 3;
  int tx, ty = -1;
  while (++ppp < 22) {
    for (i = 0; i < 4; i++) {
      if (T[i].name == "BERLAND")
        ws = i;
      else if (T[i].bs < 3)
        bt = i;
    }
    T[ws].wn++;
    T[bt].ls++;
    sort(T, T + 4, cmp);
    y++;
    y = max(y, 1);
    tx = 0;
    if (T[1].name == "BERLAND" || T[0].name == "BERLAND") {
      Tm Tt[4];
      Tt[0] = T[0];
      Tt[1] = T[1];
      Tt[2] = T[2];
      Tt[3] = T[3];
      tx = 0;
      while ((Tt[1].name == "BERLAND" || Tt[0].name == "BERLAND") && tx < y) {
        for (i = 0; i < 4; i++) {
          if (Tt[i].name == "BERLAND")
            ws = i;
          else if (Tt[i].bs < 3)
            bt = i;
        }
        Tt[ws].ls++;
        Tt[bt].wn++;
        sort(Tt, Tt + 4, cmp);
        tx++;
      }
      tx--;
      tx = max(0, tx);
      if (ty == -1) {
        x = tx;
        ty = y;
        continue;
      }
      if (y - tx < ty - x) {
        x = tx;
        ty = y;
      }
    }
  }
  cout << ty << ':' << x << endl;
  return 0;
}
