#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int numRoad, numInt, caseId, numAddAlpha, numName;
  caseId = 1;
  while (1) {
    scanf("%d %d", &numRoad, &numInt);
    if (numRoad == 0 && numInt == 0)
      break;
    numName = numInt;
    for (numAddAlpha = 0; numAddAlpha <= 26; numAddAlpha++) {
      if (numName >= numRoad)
        break;
      numName += numInt;
    }
    printf("Case %d: ", caseId);
    if (numAddAlpha > 26)
      printf("impossible\n");
    else
      printf("%d\n", numAddAlpha);
    caseId++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1163 <main+0x43>
cmpl   $0x0,-0xc(%rbp)
jne    1163 <main+0x43>
jmp    11ef <main+0xcf>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1a,-0x14(%rbp)
jg     11a2 <main+0x82>
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     118b <main+0x6b>
jmp    11a2 <main+0x82>
mov    -0xc(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1170 <main+0x50>
mov    -0x10(%rbp),%esi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1a,-0x14(%rbp)
jle    11d0 <main+0xb0>
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e1 <main+0xc1>
mov    -0x14(%rbp),%esi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%ecx
mov    %eax,%edx
or     %ecx,%edx
jne    116d <main+0x3d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ebx
lea    0xe8d(%rip),%r14
lea    0xe80(%rip),%r12
lea    0x4(%rsp),%r13
mov    %rsp,%rbp
jmp    11ce <main+0x9e>
nopw   0x0(%rax,%rax,1)
xor    %r15d,%r15d
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe6a(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%ecx
mov    %eax,%edx
or     %ecx,%edx
je     115c <main+0x2c>
cmp    %eax,%ecx
jge    1190 <main+0x60>
lea    (%rcx,%rcx,1),%edx
mov    $0xffffffff,%r15d
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15d
cmp    $0x19,%r15d
ja     11f3 <main+0xc3>
lea    (%rdx,%rcx,1),%esi
cmp    %eax,%edx
mov    %esi,%edx
jl     11e0 <main+0xb0>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1a,%r15d
jb     1220 <main+0xf0>
lea    0xe08(%rip),%rdi
call   1030 <puts@plt>
jmp    11b0 <main+0x80>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r15d
jmp    119f <main+0x6f>

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [10 x i8] c"Case %d: \00"
@.str.2 = [12 x i8] c"impossible\0A\00"
@.str.3 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %4
br label %7
7: ; preds = %0, %42
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11
br label %45
15: ; preds = %11, %7
%16 = load i32, i32* %3
store i32 %16, i32* %6
store i32 0, i32* %5
br label %17
17: ; preds = %29, %15
%18 = load i32, i32* %5
%19 = icmp sle i32 %18, 26
br i1 %19, label %20, label %32
20: ; preds = %17
%21 = load i32, i32* %6
%22 = load i32, i32* %2
%23 = icmp sge i32 %21, %22
br i1 %23, label %24, label %25
24: ; preds = %20
br label %32
25: ; preds = %20
%26 = load i32, i32* %3
%27 = load i32, i32* %6
%28 = add nsw i32 %27, %26
store i32 %28, i32* %6
br label %29
29: ; preds = %25
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %17
32: ; preds = %24, %17
%33 = load i32, i32* %4
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%35 = load i32, i32* %5
%36 = icmp sgt i32 %35, 26
br i1 %36, label %37, label %39
37: ; preds = %32
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %42
39: ; preds = %32
%40 = load i32, i32* %5
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %39, %37
%43 = load i32, i32* %4
%44 = add nsw i32 %43, 1
store i32 %44, i32* %4
br label %7
45: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [10 x i8] c"Case %d: \00"
@.str.3 = [4 x i8] c"%d\0A\00"
@str = [11 x i8] c"impossible\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
%10 = select i1 %7, i1 %9, i1 false
br i1 %10, label %42, label %11
11: ; preds = %0, %34
%12 = phi i32 [ %39, %34 ], [ %8, %0 ]
%13 = phi i32 [ %37, %34 ], [ %6, %0 ]
%14 = phi i32 [ %35, %34 ], [ 1, %0 ]
%15 = icmp slt i32 %12, %13
br i1 %15, label %18, label %16
16: ; preds = %11
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %31
18: ; preds = %11, %18
%19 = phi i32 [ %21, %18 ], [ %12, %11 ]
%20 = phi i32 [ %22, %18 ], [ 0, %11 ]
%21 = add nsw i32 %19, %12
%22 = add nuw nsw i32 %20, 1
%23 = icmp ult i32 %20, 26
%24 = icmp slt i32 %21, %13
%25 = select i1 %23, i1 %24, i1 false
br i1 %25, label %18, label %26
26: ; preds = %18
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%28 = icmp ugt i32 %20, 25
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %34
31: ; preds = %16, %26
%32 = phi i32 [ 0, %16 ], [ %22, %26 ]
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %31, %29
%35 = add nuw nsw i32 %14, 1
%36 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%37 = load i32, i32* %1
%38 = icmp eq i32 %37, 0
%39 = load i32, i32* %2
%40 = icmp eq i32 %39, 0
%41 = select i1 %38, i1 %40, i1 false
br i1 %41, label %42, label %11
42: ; preds = %34, %0
ret i32 0
}