#include <bits/stdc++.h>
using namespace std;
void dbg_out() { cerr << "\b\b]\n"; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) {
  cerr << H << ", ";
  dbg_out(T...);
}
struct Node {
  string name;
  int points, scored, missed;
  Node() {}
  Node(string n, int p, int s, int m) {
    name = n;
    points = p;
    scored = s;
    missed = m;
  }
  friend bool operator<(Node a, Node b) {
    if (a.points != b.points) return a.points > b.points;
    if (a.scored - a.missed != b.scored - b.missed) {
      return a.scored - a.missed > b.scored - b.missed;
    }
    if (a.scored != b.scored) return a.scored > b.scored;
    return a.name < b.name;
  }
};
vector<string> split(string s, char delim) {
  vector<string> v;
  stringstream ss(s);
  while (ss.good()) {
    string stk;
    getline(ss, stk, delim);
    if (stk.empty()) continue;
    v.push_back(stk);
  }
  return v;
}
const string B = "BERLAND";
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  map<string, int> points;
  map<string, int> missed;
  map<string, int> scored;
  map<string, int> matches;
  int mx1 = -1, mx2 = -1;
  for (int i = 1; i <= 5; ++i) {
    string s;
    getline(cin, s);
    vector<string> v = split(s, ' ');
    vector<string> vs = split(v[2], ':');
    matches[v[0]]++;
    matches[v[1]]++;
    missed[v[0]] += stoi(vs[1]);
    missed[v[1]] += stoi(vs[0]);
    scored[v[0]] += stoi(vs[0]);
    scored[v[1]] += stoi(vs[1]);
    if (vs[0] > vs[1]) {
      points[v[0]] += 3;
    } else if (vs[1] > vs[0]) {
      points[v[1]] += 3;
    } else {
      points[v[0]]++;
      points[v[1]]++;
    }
  }
  string opp;
  for (auto i : points) {
    if (i.second >= mx1) {
      mx2 = mx1;
      mx1 = i.second;
    } else if (i.second > mx2) {
      mx2 = i.second;
    }
    if (i.first != B and matches[i.first] == 2) opp = i.first;
  }
  if (points[B] + 3 < mx2) {
    cout << "IMPOSSIBLE";
    return 0;
  }
  if (points[B] + 3 > mx2) {
    cout << "1:0";
    return 0;
  }
  points[B] += 3;
  scored[B]++;
  missed[opp]++;
  vector<Node> A;
  for (auto i : matches) {
    int a = points[i.first];
    int b = missed[i.first];
    int c = scored[i.first];
    A.push_back({i.first, a, c, b});
  }
  sort(A.begin(), A.end());
  auto inc = [&](string a, int b, int c) {
    for (auto &i : A) {
      if (i.name == a) {
        i.scored += b;
        i.missed += c;
      }
    }
    scored[a] += b;
    missed[a] += c;
  };
  int s = 1, m = 0;
  while (true) {
    if (A[0].name == B or A[1].name == B) break;
    if (A[1].scored - A[1].missed > scored[B] - missed[B]) {
      s++;
      inc(B, 1, 0);
      inc(opp, 0, 1);
    } else {
      if (A[1].name == opp) {
        inc(B, 1, 0);
        inc(opp, 0, 1);
        s++;
      } else {
        inc(B, 1, 1);
        s++;
        m++;
      }
    }
    sort(A.begin(), A.end());
  }
  cout << s << ":" << m;
  return 0;
}
