#include <bits/stdc++.h>
using namespace std;
struct team {
  string name;
  int sc, og;
  int pts, played;
};
vector<string> getWords(string sen) {
  istringstream iss(sen);
  vector<string> wyn;
  string slowo;
  while (true) {
    iss >> slowo;
    if (!iss) break;
    wyn.push_back(slowo);
  }
  return wyn;
}
bool cmp(team a, team b) {
  if (a.pts != b.pts) return a.pts > b.pts;
  if (a.sc - a.og != b.sc - b.og) return a.sc - a.og > b.sc - b.og;
  if (a.sc != b.sc) return a.sc > b.sc;
  return a.name < b.name;
}
team teams[4];
char tmp[111];
vector<string> v;
map<string, int> mp;
void copyteam(team &a, team &b) {
  a.name = b.name;
  a.og = b.og;
  a.played = b.played;
  a.pts = b.pts;
  a.sc = b.sc;
  return;
}
int main() {
  int b = 0;
  for (int i = 0; i < 5; i++) {
    v.clear();
    for (int j = 0; j < 3; j++) {
      scanf("%s", tmp);
      v.push_back(tmp);
    }
    string num = "";
    int n1 = -1, n2 = -1;
    if (mp.count(v[0]) == 0) mp[v[0]] = b++;
    if (mp.count(v[1]) == 0) mp[v[1]] = b++;
    for (int i = 0; i < v[2].size(); i++) {
      if (v[2][i] == ':') {
        sscanf(num.c_str(), "%d", &n1);
        num = "";
        continue;
      }
      num += v[2][i];
    }
    sscanf(num.c_str(), "%d", &n2);
    num = "";
    if (n1 > n2) {
      int ind = mp[v[0]];
      teams[ind].pts += 3;
      teams[ind].name = v[0];
      teams[ind].sc += n1;
      teams[ind].og += n2;
      teams[ind].played++;
      int ind2 = mp[v[1]];
      teams[ind2].name = v[1];
      teams[ind2].sc += n2;
      teams[ind2].og += n1;
      teams[ind2].played++;
    } else if (n1 < n2) {
      int ind = mp[v[1]];
      teams[ind].pts += 3;
      teams[ind].name = v[1];
      teams[ind].sc += n2;
      teams[ind].og += n1;
      teams[ind].played++;
      int ind2 = mp[v[0]];
      teams[ind2].name = v[0];
      teams[ind2].sc += n1;
      teams[ind2].og += n2;
      teams[ind2].played++;
    } else {
      int ind = mp[v[0]], ind2 = mp[v[1]];
      teams[ind].name = v[0];
      teams[ind].sc += n1;
      teams[ind].og += n2;
      teams[ind].pts += 1;
      teams[ind].played++;
      teams[ind2].name = v[1];
      teams[ind2].sc += n2;
      teams[ind2].og += n1;
      teams[ind2].pts += 1;
      teams[ind2].played++;
    }
  }
  int ii = 0, jj = 0;
  sort(teams, teams + 4, cmp);
  for (int i = 0; i < 4; i++) {
    if (teams[i].played == 2 && teams[i].name != "BERLAND")
      jj = i;
    else if (teams[i].played == 2)
      ii = i;
  }
  int d = teams[1].sc - teams[1].og;
  team tt[4];
  for (int i = 0; i < 4; i++) tt[i] = teams[i];
  int i;
  int ansx = -1, ansy = -1, diff = 1 << 30;
  int f = 0;
  for (i = 1; i <= 100; i++) {
    for (int j = 0; j < i; j++) {
      copyteam(teams[ii], tt[ii]);
      teams[ii].pts += 3;
      teams[ii].sc += i;
      teams[ii].og += j;
      teams[jj].og += i;
      teams[jj].sc += j;
      sort(teams, teams + 4, cmp);
      if (teams[0].name == "BERLAND" || teams[1].name == "BERLAND") {
        if (i - j <= diff) {
          if (i - j == diff)
            f++;
          else
            f = 0;
          diff = i - j;
          ansx = i;
          ansy = j;
        }
      }
      for (int i = 0; i < 4; i++) copyteam(teams[i], tt[i]);
    }
  }
  int yval = 1 << 30;
  if (f > 1) {
    for (i = 1; i <= 100; i++) {
      for (int j = 0; j < i; j++) {
        copyteam(teams[ii], tt[ii]);
        teams[ii].pts += 3;
        teams[ii].sc += i;
        teams[ii].og += j;
        teams[jj].og += i;
        teams[jj].sc += j;
        sort(teams, teams + 4, cmp);
        if (teams[0].name == "BERLAND" || teams[1].name == "BERLAND") {
          if (i - j == diff) {
            if (j < yval) {
              yval = j;
              ansx = i;
              ansy = j;
            }
          }
        }
        for (int i = 0; i < 4; i++) copyteam(teams[i], tt[i]);
      }
    }
  }
  if (diff == 1 << 30)
    printf("IMPOSSIBLE\n");
  else
    printf("%d:%d\n", ansx, ansy);
}
