#include <bits/stdc++.h>
using namespace std;
struct S {
  string name;
  int point, loss, win, jin, ci;
} s[6];
void input() {
  string a1, a2;
  int b1, b2;
  int c1, c2;
  char d;
  int k = 0;
  for (int i = 1; i <= 5; ++i) {
    cin >> a1 >> a2;
    cin >> b1 >> d >> b2;
    if (b1 > b2) {
      c1 = 3;
      c2 = 0;
    }
    if (b1 == b2) {
      c1 = 1;
      c2 = 1;
    }
    if (b1 < b2) {
      c1 = 0;
      c2 = 3;
    }
    int j;
    for (j = 1; j <= k; ++j)
      if (s[j].name == a1) {
        break;
      }
    if (j > k) {
      ++k;
      s[k].name = a1;
    }
    s[j].point += c1;
    s[j].loss += b2;
    s[j].win += b1;
    s[j].ci += 1;
    for (j = 1; j <= k; ++j)
      if (s[j].name == a2) {
        break;
      }
    if (j > k) {
      ++k;
      s[k].name = a2;
    }
    s[j].point += c2;
    s[j].loss += b1;
    s[j].win += b2;
    s[j].ci += 1;
  }
  for (int i = 1; i <= 4; ++i) s[i].jin = s[i].win - s[i].loss;
  return;
}
void chang(int a, int b) {
  S R;
  R = s[a];
  s[a] = s[b];
  s[b] = R;
  return;
}
int main() {
  for (int i = 1; i <= 4; ++i) {
    s[i].loss = s[i].point = s[i].win = s[i].jin = 0;
    s[i].name = "";
  }
  input();
  for (int i = 1; i < 4; ++i)
    for (int j = i + 1; j <= 4; ++j) {
      if (s[i].point < s[j].point) chang(i, j);
      if (s[i].point == s[j].point && s[i].jin < s[j].jin) chang(i, j);
      if (s[i].point == s[j].point && s[i].jin == s[j].jin &&
          s[i].win < s[j].win)
        chang(i, j);
      if (s[i].point == s[j].point && s[i].jin == s[j].jin &&
          s[i].win == s[j].win && s[i].name > s[j].name)
        chang(i, j);
    }
  int k = 0;
  for (int i = 1; i <= 4; ++i)
    if (s[i].name == "BERLAND") {
      k = i;
      break;
    }
  if (k <= 2)
    cout << "1:0" << endl;
  else {
    if (s[k].point + 3 < s[2].point) {
      cout << "IMPOSSIBLE" << endl;
      return 0;
    }
    if (s[k].point + 3 > s[2].point) {
      cout << "1:0" << endl;
      return 0;
    }
    int res = 0, res2 = 0;
    int h = 1;
    s[k].point += 3;
    while (1) {
      for (int i = 1; i <= 4; ++i)
        if (s[i].ci == 2 && s[i].name != "BERLAND") {
          h = i;
          break;
        }
      for (int i = 1; i <= 4; ++i)
        if (s[i].name == "BERLAND") {
          k = i;
          break;
        }
      if (k == 2 || k == 1 || (k == 3 && s[k].jin == s[2].jin)) {
        while (1) {
          for (int i = 1; i < 4; ++i)
            for (int j = i + 1; j <= 4; ++j) {
              if (s[i].point < s[j].point) chang(i, j);
              if (s[i].point == s[j].point && s[i].jin < s[j].jin) chang(i, j);
              if (s[i].point == s[j].point && s[i].jin == s[j].jin &&
                  s[i].win < s[j].win)
                chang(i, j);
              if (s[i].point == s[j].point && s[i].jin == s[j].jin &&
                  s[i].win == s[j].win && s[i].name > s[j].name)
                chang(i, j);
            }
          for (int i = 1; i <= 4; ++i)
            if (s[i].ci == 2 && s[i].name != "BERLAND") {
              h = i;
              break;
            }
          for (int i = 1; i <= 4; ++i)
            if (s[i].name == "BERLAND") {
              k = i;
              break;
            }
          if (k == 2 || k == 1)
            break;
          else {
            ++res;
            ++res2;
          }
          if (h == 2) {
            cout << res << ":" << res2 - 1 << endl;
            return 0;
          }
          s[h].win += 1;
          s[k].win += 1;
        }
        break;
      } else
        ++res;
      s[k].win += 1;
      s[k].jin += 1;
      s[h].jin -= 1;
      for (int i = 1; i < 4; ++i)
        for (int j = i + 1; j <= 4; ++j) {
          if (s[i].point < s[j].point) chang(i, j);
          if (s[i].point == s[j].point && s[i].jin < s[j].jin) chang(i, j);
          if (s[i].point == s[j].point && s[i].jin == s[j].jin &&
              s[i].name > s[j].name)
            chang(i, j);
        }
    }
    cout << res << ":" << res2 << endl;
    return 0;
  }
}
