// Arup Guha
// 6/18/2014
// Solution to 2003 World Finals Problem B: Light Bulbs

import java.util.*;
import java.math.*;

public class bulbs {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		BigInteger start = new BigInteger(stdin.next());
		BigInteger end = new BigInteger(stdin.next());
		int loop = 1;

		// Go through each case.
		while (!start.equals(BigInteger.ZERO) || !end.equals(BigInteger.ZERO)) {

			if (loop > 1) System.out.println();

			// The xor here is key - it's what needs to change.
			int n = Math.max(start.bitLength(), end.bitLength());
			BigInteger res = start.xor(end);
			BigInteger sol1 = null;
			BigInteger sol2 = null;
			int[] prev1 = new int[2];
			int[] prev2 = new int[2];
			int numOnes1 = 0, numOnes2 = 0;

			// Starting solutions from lsb.
			if (res.testBit(0))	{
				sol1 = new BigInteger("1");
				sol2 = new BigInteger("2");
				prev1[0] = 0; prev1[1] = 1;
				prev2[0] = 1; prev2[1] = 0;
				numOnes1++;
				numOnes2++;
			}
			else {
				sol1 = new BigInteger("0");
				sol2 = new BigInteger("3");
				prev1[0] = 0; prev1[1] = 0;
				prev2[0] = 1; prev2[1] = 1;
				numOnes2 += 2;
			}

			// We start from here - bit i in our answers is what we're fixing.
			for (int i=2; i<n; i++) {

				// Calculate what the current bit is in our xor.
				int cur = res.testBit(i-1) ? 1:0;

				// This is the criterion for setting the current bit in this answer.
				if (cur != (prev1[0] ^ prev1[1]) ) {
					sol1 = sol1.setBit(i);
					prev1[1] = prev1[0];
					prev1[0] = 1;
					numOnes1++;
				}

				// Or don't set it.
				else {
					prev1[1] = prev1[0];
					prev1[0] = 0;
				}

				// Repeat for the second possible answer.
				if (cur != (prev2[0] ^ prev2[1]) ) {
					sol2 = sol2.setBit(i);
					prev2[1] = prev2[0];
					prev2[0] = 1;
					numOnes2++;
				}
				else {
					prev2[1] = prev2[0];
					prev2[0] = 0;
				}

			}

			// Start output
			System.out.print("Case Number "+loop+": ");

			// Calculate what the last bit is in our results.
			int last1 = prev1[1] ^ prev1[0];
			int last2 = prev2[1] ^ prev2[0];

			// Check for consistency here.
			boolean match1 = consistent(last1, res, n-1);
			boolean match2 = consistent(last2, res, n-1);


			// Tiebreaker condition.
			if (match1 && match2) {

				// First look at # of ones, then value.
				if ((numOnes1 < numOnes2) || (numOnes1 == numOnes2 && sol1.compareTo(sol2)  < 0) )
					System.out.println(sol1);
				else
					System.out.println(sol2);
			}

			// These cases are clear.
			else if (match1) System.out.println(sol1);
			else if (match2) System.out.println(sol2);
			else             System.out.println("impossible");

			// Go to the next case.
			start = new BigInteger(stdin.next());
			end = new BigInteger(stdin.next());
			loop++;
		}
	}

	// Tests for the consistency of sol with bit at loc.
	public static boolean consistent(int bit, BigInteger sol, int loc) {
		return (sol.testBit(loc) && bit == 1) || (!sol.testBit(loc) && bit == 0);
	}
}