import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int h = Integer.parseInt(str[0]);
		int w = Integer.parseInt(str[1]);
		
		for(int i=0;i<=1000000000;i++) {
			int a=Math.abs(h-i);
			int b=Math.abs(w-i);
			
			if(a==b) {
				System.out.println(i);
				return;
			}
		}
		
		System.out.println("IMPOSSIBLE");
		
		/*int k = Integer.parseInt(str[2]);

		String matrix[][] = new String[h][w];

		for (int i = 0; i < h; i++) {
			str = br.readLine().split("");
			for (int j = 0; j < w; j++) {
				matrix[i][j] = str[j];
			}
		}

		int cur = 1;
		int ans[][] = new int[h][w];

		for (int i = 0; i < h; i++) {
			boolean first = true;
			for (int j = 0; j < w; j++) {
				if (matrix[i][j].equals("#")) {
					if (first)
						first = false;
					else
						cur++;
				}
				ans[i][j] = cur;
			}
			cur++;
		}

		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				System.out.print(ans[i][j] + " ");
			}
			System.out.println();
		}*/
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int h = Integer.parseInt(str[0]);
		int w = Integer.parseInt(str[1]);
		
		for(int i=0;i<=1000000000;i++) {
			int a=Math.abs(h-i);
			int b=Math.abs(w-i);
			
			if(a==b) {
				System.out.println(i);
				return;
			}
		}
		
		System.out.println("IMPOSSIBLE");
		
		/*int k = Integer.parseInt(str[2]);

		String matrix[][] = new String[h][w];

		for (int i = 0; i < h; i++) {
			str = br.readLine().split("");
			for (int j = 0; j < w; j++) {
				matrix[i][j] = str[j];
			}
		}

		int cur = 1;
		int ans[][] = new int[h][w];

		for (int i = 0; i < h; i++) {
			boolean first = true;
			for (int j = 0; j < w; j++) {
				if (matrix[i][j].equals("#")) {
					if (first)
						first = false;
					else
						cur++;
				}
				ans[i][j] = cur;
			}
			cur++;
		}

		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				System.out.print(ans[i][j] + " ");
			}
			System.out.println();
		}*/
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int h = Integer.parseInt(str[0]);
		int w = Integer.parseInt(str[1]);
		
		for(int i=0;i<=1000000000;i++) {
			int a=Math.abs(h-i);
			int b=Math.abs(w-i);
			
			if(a==b) {
				System.out.println(i);
				return;
			}
		}
		
		System.out.println("IMPOSSIBLE");
		
		/*int k = Integer.parseInt(str[2]);

		String matrix[][] = new String[h][w];

		for (int i = 0; i < h; i++) {
			str = br.readLine().split("");
			for (int j = 0; j < w; j++) {
				matrix[i][j] = str[j];
			}
		}

		int cur = 1;
		int ans[][] = new int[h][w];

		for (int i = 0; i < h; i++) {
			boolean first = true;
			for (int j = 0; j < w; j++) {
				if (matrix[i][j].equals("#")) {
					if (first)
						first = false;
					else
						cur++;
				}
				ans[i][j] = cur;
			}
			cur++;
		}

		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				System.out.print(ans[i][j] + " ");
			}
			System.out.println();
		}*/
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int h = Integer.parseInt(str[0]);
		int w = Integer.parseInt(str[1]);
		
		for(int i=0;i<=1000000000;i++) {
			int a=Math.abs(h-i);
			int b=Math.abs(w-i);
			
			if(a==b) {
				System.out.println(i);
				return;
			}
		}
		
		System.out.println("IMPOSSIBLE");
		
		/*int k = Integer.parseInt(str[2]);

		String matrix[][] = new String[h][w];

		for (int i = 0; i < h; i++) {
			str = br.readLine().split("");
			for (int j = 0; j < w; j++) {
				matrix[i][j] = str[j];
			}
		}

		int cur = 1;
		int ans[][] = new int[h][w];

		for (int i = 0; i < h; i++) {
			boolean first = true;
			for (int j = 0; j < w; j++) {
				if (matrix[i][j].equals("#")) {
					if (first)
						first = false;
					else
						cur++;
				}
				ans[i][j] = cur;
			}
			cur++;
		}

		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				System.out.print(ans[i][j] + " ");
			}
			System.out.println();
		}*/
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str[] = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int h = Integer.parseInt(str[0]); h Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int w = Integer.parseInt(str[1]); w Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 for(int i=0;i<=1000000000;i++) {
			int a=Math.abs(h-i);
			int b=Math.abs(w-i);
			
			if(a==b) {
				System.out.println(i);
				return;
			}
		} int i=0; int i=0; i 0 i<=1000000000 i 1000000000 i++ i++ i {
			int a=Math.abs(h-i);
			int b=Math.abs(w-i);
			
			if(a==b) {
				System.out.println(i);
				return;
			}
		} {
			int a=Math.abs(h-i);
			int b=Math.abs(w-i);
			
			if(a==b) {
				System.out.println(i);
				return;
			}
		} int a=Math.abs(h-i); a Math.abs(h-i) Math.abs Math h-i h i int b=Math.abs(w-i); b Math.abs(w-i) Math.abs Math w-i w i if(a==b) {
				System.out.println(i);
				return;
			} a==b a b {
				System.out.println(i);
				return;
			} System.out.println(i) System.out.println System.out System System.out i return; System.out.println("IMPOSSIBLE") System.out.println System.out System System.out "IMPOSSIBLE" String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int h = Integer.parseInt(str[0]);
		int w = Integer.parseInt(str[1]);
		
		for(int i=0;i<=1000000000;i++) {
			int a=Math.abs(h-i);
			int b=Math.abs(w-i);
			
			if(a==b) {
				System.out.println(i);
				return;
			}
		}
		
		System.out.println("IMPOSSIBLE");
		
		/*int k = Integer.parseInt(str[2]);

		String matrix[][] = new String[h][w];

		for (int i = 0; i < h; i++) {
			str = br.readLine().split("");
			for (int j = 0; j < w; j++) {
				matrix[i][j] = str[j];
			}
		}

		int cur = 1;
		int ans[][] = new int[h][w];

		for (int i = 0; i < h; i++) {
			boolean first = true;
			for (int j = 0; j < w; j++) {
				if (matrix[i][j].equals("#")) {
					if (first)
						first = false;
					else
						cur++;
				}
				ans[i][j] = cur;
			}
			cur++;
		}

		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				System.out.print(ans[i][j] + " ");
			}
			System.out.println();
		}*/
	}
} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int h = Integer.parseInt(str[0]);
		int w = Integer.parseInt(str[1]);
		
		for(int i=0;i<=1000000000;i++) {
			int a=Math.abs(h-i);
			int b=Math.abs(w-i);
			
			if(a==b) {
				System.out.println(i);
				return;
			}
		}
		
		System.out.println("IMPOSSIBLE");
		
		/*int k = Integer.parseInt(str[2]);

		String matrix[][] = new String[h][w];

		for (int i = 0; i < h; i++) {
			str = br.readLine().split("");
			for (int j = 0; j < w; j++) {
				matrix[i][j] = str[j];
			}
		}

		int cur = 1;
		int ans[][] = new int[h][w];

		for (int i = 0; i < h; i++) {
			boolean first = true;
			for (int j = 0; j < w; j++) {
				if (matrix[i][j].equals("#")) {
					if (first)
						first = false;
					else
						cur++;
				}
				ans[i][j] = cur;
			}
			cur++;
		}

		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				System.out.print(ans[i][j] + " ");
			}
			System.out.println();
		}*/
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int h = Integer.parseInt(str[0]);
		int w = Integer.parseInt(str[1]);
		
		for(int i=0;i<=1000000000;i++) {
			int a=Math.abs(h-i);
			int b=Math.abs(w-i);
			
			if(a==b) {
				System.out.println(i);
				return;
			}
		}
		
		System.out.println("IMPOSSIBLE");
		
		/*int k = Integer.parseInt(str[2]);

		String matrix[][] = new String[h][w];

		for (int i = 0; i < h; i++) {
			str = br.readLine().split("");
			for (int j = 0; j < w; j++) {
				matrix[i][j] = str[j];
			}
		}

		int cur = 1;
		int ans[][] = new int[h][w];

		for (int i = 0; i < h; i++) {
			boolean first = true;
			for (int j = 0; j < w; j++) {
				if (matrix[i][j].equals("#")) {
					if (first)
						first = false;
					else
						cur++;
				}
				ans[i][j] = cur;
			}
			cur++;
		}

		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				System.out.print(ans[i][j] + " ");
			}
			System.out.println();
		}*/
	}
}
