/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Scanner;
import  java.lang.Math;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner in = new Scanner(System.in);
		int m1,m2,m3,x;
		m1 = in.nextInt();
		m2 = in.nextInt();
		m3 = in.nextInt();
		if ( ( m1 + m2 + m3 ) % 3 == 0 ) 
		{
			if ( m1 != m2 && m1 != m3 && m2 != m3 ) 
			{
				System.out.print(Math.max ( Math.max ( m1 , m2 ) , m3 ) - ( ( m1 + m2 + m3 ) / 3 ));
			}
			else if ( m1 == m2 ) 
			{ 
            	x = ( m3 - ( m1 + m2 + m3 ) / 3 );
            	if ( x < 0 ) 
            	{ 
                	System.out.print(-x); 
            	} 
            	else System.out.print(x);
    		}
    		else if ( m1 == m3 ) { 
            	x = ( m2 - ( m1 + m2 + m3 ) / 3 );
            	if ( x < 0 ) 
            	{ 
                	System.out.print(-x);
            	} 
            	else System.out.print(x);
    		}
    		else if ( m2 == m3 ) { 
            	x = ( m1 - ( m1 + m2 + m3 ) / 3 );
            	if ( x < 0 ) 
            	{ 
                	System.out.print(-x); 
            	} 
            	else System.out.print(x);
            }
		}
		else System.out.print("IMPOSSIBLE");
	}
}