#include <bits/stdc++.h>
using namespace std;
string s1[10], s2[10], score[10];
map<string, int> mp;
string name[10];
int a[10][10];
bool better(int x, int y) {
  int i;
  int sx = 0, px = 0, mx = 0, sy = 0, py = 0, my = 0;
  for ((i) = 0; (i) < (int)(4); (i)++)
    if (i != x) {
      if (a[x][i] > a[i][x])
        sx += 3;
      else if (a[x][i] == a[i][x])
        sx++;
      px += a[x][i];
      mx += a[i][x];
    }
  for ((i) = 0; (i) < (int)(4); (i)++)
    if (i != y) {
      if (a[y][i] > a[i][y])
        sy += 3;
      else if (a[y][i] == a[i][y])
        sy++;
      py += a[y][i];
      my += a[i][y];
    }
  if (sx != sy) return (sx > sy);
  if (px - mx != py - my) return (px - mx > py - my);
  if (px != py) return (px > py);
  return (x < y);
}
bool check(int x, int y) {
  int i;
  int b = mp["BERLAND"];
  int c;
  for ((i) = 0; (i) < (int)(4); (i)++)
    if (i != b && a[b][i] == -1) c = i;
  a[b][c] = x;
  a[c][b] = y;
  int rank = 1;
  for ((i) = 0; (i) < (int)(4); (i)++)
    if (i != b && better(i, b)) rank++;
  a[b][c] = a[c][b] = -1;
  return (rank <= 2);
}
int main(void) {
  int d, i, j;
  for ((i) = 0; (i) < (int)(5); (i)++) cin >> s1[i] >> s2[i] >> score[i];
  for ((i) = 0; (i) < (int)(5); (i)++) mp[s1[i]] = mp[s2[i]] = 0;
  i = 0;
  for (__typeof((mp).begin()) itr = (mp).begin(); itr != (mp).end(); itr++) {
    (itr->second) = i;
    name[i] = (itr->first);
    i++;
  }
  for ((i) = 0; (i) < (int)(4); (i)++)
    for ((j) = 0; (j) < (int)(4); (j)++) a[i][j] = -1;
  for ((i) = 0; (i) < (int)(5); (i)++) {
    int x = mp[s1[i]], y = mp[s2[i]];
    for ((j) = 0; (j) < (int)(score[i].length()); (j)++)
      if (score[i][j] == ':') score[i][j] = ' ';
    istringstream ss(score[i]);
    ss >> a[x][y] >> a[y][x];
  }
  for (d = 1; d < 100; d++)
    for ((i) = 0; (i) < (int)(100); (i)++) {
      j = i + d;
      if (check(j, i)) {
        cout << j << ":" << i << endl;
        return 0;
      }
    }
  cout << "IMPOSSIBLE" << endl;
  return 0;
}
