public class Main {
	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int l = 0;
                int[] a = new int[l];
		int[] b = new int[l];

		do {
			int x = sc.nextInt();
			if (x == 0) {
				break;
			}
			l++;
			a = new int[l];
			for (int i = 0; i < l - 1; i++) {
				a[i] = b[i];
			}
			a[l - 1] = x;
			b = new int[l];
			for (int i = 0; i < l; i++) {
				b[i] = a[i];
			}
		} while (true);

		for (int i = 0;i < b.length;i++) {
			System.out.println("Case " + (i+1) + ": " + b[i]);
		}
	}
} public class Main {
	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int l = 0;
                int[] a = new int[l];
		int[] b = new int[l];

		do {
			int x = sc.nextInt();
			if (x == 0) {
				break;
			}
			l++;
			a = new int[l];
			for (int i = 0; i < l - 1; i++) {
				a[i] = b[i];
			}
			a[l - 1] = x;
			b = new int[l];
			for (int i = 0; i < l; i++) {
				b[i] = a[i];
			}
		} while (true);

		for (int i = 0;i < b.length;i++) {
			System.out.println("Case " + (i+1) + ": " + b[i]);
		}
	}
} Main public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int l = 0;
                int[] a = new int[l];
		int[] b = new int[l];

		do {
			int x = sc.nextInt();
			if (x == 0) {
				break;
			}
			l++;
			a = new int[l];
			for (int i = 0; i < l - 1; i++) {
				a[i] = b[i];
			}
			a[l - 1] = x;
			b = new int[l];
			for (int i = 0; i < l; i++) {
				b[i] = a[i];
			}
		} while (true);

		for (int i = 0;i < b.length;i++) {
			System.out.println("Case " + (i+1) + ": " + b[i]);
		}
	} main {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int l = 0;
                int[] a = new int[l];
		int[] b = new int[l];

		do {
			int x = sc.nextInt();
			if (x == 0) {
				break;
			}
			l++;
			a = new int[l];
			for (int i = 0; i < l - 1; i++) {
				a[i] = b[i];
			}
			a[l - 1] = x;
			b = new int[l];
			for (int i = 0; i < l; i++) {
				b[i] = a[i];
			}
		} while (true);

		for (int i = 0;i < b.length;i++) {
			System.out.println("Case " + (i+1) + ": " + b[i]);
		}
	} java.util.Scanner sc = new java.util.Scanner(System.in); sc new java.util.Scanner(System.in) int l = 0; l 0 int[] a = new int[l]; a new int[l] l int[] b = new int[l]; b new int[l] l do {
			int x = sc.nextInt();
			if (x == 0) {
				break;
			}
			l++;
			a = new int[l];
			for (int i = 0; i < l - 1; i++) {
				a[i] = b[i];
			}
			a[l - 1] = x;
			b = new int[l];
			for (int i = 0; i < l; i++) {
				b[i] = a[i];
			}
		} while (true); true {
			int x = sc.nextInt();
			if (x == 0) {
				break;
			}
			l++;
			a = new int[l];
			for (int i = 0; i < l - 1; i++) {
				a[i] = b[i];
			}
			a[l - 1] = x;
			b = new int[l];
			for (int i = 0; i < l; i++) {
				b[i] = a[i];
			}
		} int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc if (x == 0) {
				break;
			} x == 0 x 0 {
				break;
			} break; l++ l a = new int[l] a new int[l] l for (int i = 0; i < l - 1; i++) {
				a[i] = b[i];
			} int i = 0; int i = 0; i 0 i < l - 1 i l - 1 l 1 i++ i++ i {
				a[i] = b[i];
			} {
				a[i] = b[i];
			} a[i] = b[i] a[i] a i b[i] b i a[l - 1] = x a[l - 1] a l - 1 l 1 x b = new int[l] b new int[l] l for (int i = 0; i < l; i++) {
				b[i] = a[i];
			} int i = 0; int i = 0; i 0 i < l i l i++ i++ i {
				b[i] = a[i];
			} {
				b[i] = a[i];
			} b[i] = a[i] b[i] b i a[i] a i for (int i = 0;i < b.length;i++) {
			System.out.println("Case " + (i+1) + ": " + b[i]);
		} int i = 0; int i = 0; i 0 i < b.length i b.length b b.length i++ i++ i {
			System.out.println("Case " + (i+1) + ": " + b[i]);
		} {
			System.out.println("Case " + (i+1) + ": " + b[i]);
		} System.out.println("Case " + (i+1) + ": " + b[i]) System.out.println System.out System System.out "Case " + (i+1) + ": " + b[i] ": " "Case " + (i+1) + ": " + b[i] "Case " (i+1) i 1 ": " b[i] b i String[] args args public class Main {
	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int l = 0;
                int[] a = new int[l];
		int[] b = new int[l];

		do {
			int x = sc.nextInt();
			if (x == 0) {
				break;
			}
			l++;
			a = new int[l];
			for (int i = 0; i < l - 1; i++) {
				a[i] = b[i];
			}
			a[l - 1] = x;
			b = new int[l];
			for (int i = 0; i < l; i++) {
				b[i] = a[i];
			}
		} while (true);

		for (int i = 0;i < b.length;i++) {
			System.out.println("Case " + (i+1) + ": " + b[i]);
		}
	}
} public class Main {
	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int l = 0;
                int[] a = new int[l];
		int[] b = new int[l];

		do {
			int x = sc.nextInt();
			if (x == 0) {
				break;
			}
			l++;
			a = new int[l];
			for (int i = 0; i < l - 1; i++) {
				a[i] = b[i];
			}
			a[l - 1] = x;
			b = new int[l];
			for (int i = 0; i < l; i++) {
				b[i] = a[i];
			}
		} while (true);

		for (int i = 0;i < b.length;i++) {
			System.out.println("Case " + (i+1) + ": " + b[i]);
		}
	}
} Main
public class Main {
	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int l = 0;
                int[] a = new int[l];
		int[] b = new int[l];

		do {
			int x = sc.nextInt();
			if (x == 0) {
				break;
			}
			l++;
			a = new int[l];
			for (int i = 0; i < l - 1; i++) {
				a[i] = b[i];
			}
			a[l - 1] = x;
			b = new int[l];
			for (int i = 0; i < l; i++) {
				b[i] = a[i];
			}
		} while (true);

		for (int i = 0;i < b.length;i++) {
			System.out.println("Case " + (i+1) + ": " + b[i]);
		}
	}
}