200_C. Football Championship_33416
Any resemblance to any real championship and sport is accidental.

The Berland National team takes part in the local Football championship which now has a group stage. Let's describe the formal rules of the local championship: 

  * the team that kicked most balls in the enemy's goal area wins the game; 
  * the victory gives 3 point to the team, the draw gives 1 point and the defeat gives 0 points; 
  * a group consists of four teams, the teams are ranked by the results of six games: each team plays exactly once with each other team; 
  * the teams that get places 1 and 2 in the group stage results, go to the next stage of the championship. 



In the group stage the team's place is defined by the total number of scored points: the more points, the higher the place is. If two or more teams have the same number of points, then the following criteria are used (the criteria are listed in the order of falling priority, starting from the most important one): 

  * the difference between the total number of scored goals and the total number of missed goals in the championship: the team with a higher value gets a higher place; 
  * the total number of scored goals in the championship: the team with a higher value gets a higher place; 
  * the lexicographical order of the name of the teams' countries: the country with the lexicographically smaller name gets a higher place. 



The Berland team plays in the group where the results of 5 out of 6 games are already known. To be exact, there is the last game left. There the Berand national team plays with some other team. The coach asks you to find such score X:Y (where X is the number of goals Berland scored and Y is the number of goals the opponent scored in the game), that fulfills the following conditions: 

  * X > Y, that is, Berland is going to win this game; 
  * after the game Berland gets the 1st or the 2nd place in the group; 
  * if there are multiple variants, you should choose such score X:Y, where value X - Y is minimum; 
  * if it is still impossible to come up with one score, you should choose the score where value Y (the number of goals Berland misses) is minimum. 

Input

The input has five lines.

Each line describes a game as "team1 team2 goals1:goals2" (without the quotes), what means that team team1 played a game with team team2, besides, team1 scored goals1 goals and team2 scored goals2 goals. The names of teams team1 and team2 are non-empty strings, consisting of uppercase English letters, with length of no more than 20 characters; goals1, goals2 are integers from 0 to 9. 

The Berland team is called "BERLAND". It is guaranteed that the Berland team and one more team played exactly 2 games and the the other teams played exactly 3 games.

Output

Print the required score in the last game as X:Y, where X is the number of goals Berland scored and Y is the number of goals the opponent scored. If the Berland team does not get the first or the second place in the group, whatever this game's score is, then print on a single line "IMPOSSIBLE" (without the quotes).

Note, that the result score can be very huge, 10:0 for example.

Examples

Input

AERLAND DERLAND 2:1
DERLAND CERLAND 0:3
CERLAND AERLAND 0:1
AERLAND BERLAND 2:0
DERLAND BERLAND 4:0


Output

6:0


Input

AERLAND DERLAND 2:2
DERLAND CERLAND 2:3
CERLAND AERLAND 1:3
AERLAND BERLAND 2:1
DERLAND BERLAND 4:1


Output

IMPOSSIBLE

Note

In the first sample "BERLAND" plays the last game with team "CERLAND". If Berland wins with score 6:0, the results' table looks like that in the end: 

  1. AERLAND (points: 9, the difference between scored and missed goals: 4, scored goals: 5) 
  2. BERLAND (points: 3, the difference between scored and missed goals: 0, scored goals: 6) 
  3. DERLAND (points: 3, the difference between scored and missed goals: 0, scored goals: 5) 
  4. CERLAND (points: 3, the difference between scored and missed goals: -4, scored goals: 3) 



In the second sample teams "AERLAND" and "DERLAND" have already won 7 and 4 points, respectively. The Berland team wins only 3 points, which is not enough to advance to the next championship stage.
import java.io.*;
import java.util.*;

/**
 * */
public class Solution {

	public static List<Team> listTeams=Collections.synchronizedList(new ArrayList<Team>(4));
	public static Team BERLAND=null;
	public static TeamComparator teamComparator=null;
	
	public class Team{
		public String name;
		public Map<String,Integer> selfScores=Collections.synchronizedMap(new HashMap<String,Integer>());
		public Map<String,Integer> oppScores=Collections.synchronizedMap(new HashMap<String,Integer>());
		
		public Integer points=0;
		public Integer goalDiff=0;
		public Integer goalFor=0;
		
		public Team(String name){
			this.name=name;
		}
	}
	public Team newTeam(String name){
		return new Team(name);
	}
	
	public static Team getTeam(String name){
		Iterator<Team> iter=listTeams.iterator();
		while(iter.hasNext()){
			Team team=iter.next();
			if(team.name.equals(name))
				return team;
		}
		return null;
	}
	
	public static int getBerlandRanking(){
		Iterator<Team> iter=listTeams.iterator();
		while(iter.hasNext()){
			Team team=iter.next();
			team.points=team.goalDiff=team.goalFor=0;
			Iterator<String> iterOpp=team.selfScores.keySet().iterator();
			while(iterOpp.hasNext()){
				String oppName=iterOpp.next();				
				int selfScore=team.selfScores.get(oppName);
				int oppScore=team.oppScores.get(oppName);
				team.points+=(selfScore>oppScore)?3:(selfScore==oppScore)?1:0;
				team.goalDiff+=(selfScore-oppScore);
				team.goalFor+=selfScore;
				}}
		Collections.sort(listTeams,teamComparator);
		return listTeams.indexOf(BERLAND);
	}
	
	public class TeamComparator implements Comparator<Team>{

		@Override
		public int compare(Team team1, Team team2) {
			if(team1.points.equals(team2.points)){
				if(team1.goalDiff.equals(team2.goalDiff)){
					if(team1.goalFor.equals(team2.goalFor))
						return team2.name.compareTo(team1.name);
					return team1.goalFor.compareTo(team2.goalFor);
				}
				return team1.goalDiff.compareTo(team2.goalDiff);
			}
			return team1.points.compareTo(team2.points);
		}}
	public TeamComparator newTeamComparator(){
		return new TeamComparator(); }
	
	/**
	 * @param args
	 */
	public static void main(String[] args){		
	    try {	
	    	
	    	BufferedReader reader =new BufferedReader( new InputStreamReader( System.in)); // STDIN
	    	
	    	// Teams
	    	Solution solution=new Solution();	    	
	    	listTeams.add(solution.newTeam("BERLAND"));
	    	BERLAND=getTeam("BERLAND");
	    	teamComparator=solution.newTeamComparator();
	    	
	    	//
	    	for(int i=0;i!=5;i++){
	    		String[] result=reader.readLine().trim().split(" ",3);
	    		// Team1
	    		String name1=result[0].trim();
	    		Team team1=getTeam(name1);
	    		if(team1==null){
	    			listTeams.add(solution.newTeam(name1));
	    			team1=getTeam(name1);
	    		}
	    		// Team2
	    		String name2=result[1].trim();	    		
	    		Team team2=getTeam(name2);
	    		if(team2==null){
	    			listTeams.add(solution.newTeam(name2));
	    			team2=getTeam(name2);	    			
	    		}
	    		String[] score=result[2].trim().split(":",2);
	    		Integer score1=Integer.valueOf(score[0].trim());
	    		Integer score2=Integer.valueOf(score[1].trim());
	    		team1.selfScores.put(team2.name,score1);
	    		team1.oppScores.put(team2.name,score2);
	    		team2.selfScores.put(team1.name,score2);
	    		team2.oppScores.put(team1.name,score1);
	    	}
	    	
	    	String oppName="";
	    	Iterator<Team> iterTeam=listTeams.iterator();
	    	while(iterTeam.hasNext()&&(oppName=="")){
	    		Team team=iterTeam.next();
	    		if((team.oppScores.size()==2)&&(team.name!="BERLAND"))
	    			oppName=team.name; }
	    	
	    	// 
	    	boolean bPossible=false;
	    	for(int diff=1;diff<=30;diff++){
	    		for(int opp=0;opp<=30;opp++){
	    			int selfScore=diff+opp;
	    			Team oppTeam=getTeam(oppName);
	    			oppTeam.selfScores.put(BERLAND.name,opp);
	    			oppTeam.oppScores.put(BERLAND.name,selfScore);
	    			BERLAND.selfScores.put(oppName,selfScore);
	    			BERLAND.oppScores.put(oppName,opp);
	    			if(getBerlandRanking()>=2){
	    				System.out.println(selfScore+":"+opp);
	    				bPossible=true;
	    				break;
	    			}
	    		}
	    		if(bPossible)
	    			break;
	    	}
	    	if(!bPossible)
	    		System.out.println("IMPOSSIBLE");
	    	
		    }catch(Exception e){
		    	e.printStackTrace(System.err);
		}
	}
}