#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 numAmount(int, int);
int numLength(int);
int power(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  int countFrom = 0;
  int countTo = 0;
  for (int i = 0; i < numLength(b); i++) {
    countTo = countFrom + numAmount(b, i);
    int answer = 0;
    int answerCount = numAmount(b, i) - 1;
    for (int j = countFrom; j < countTo; j++) {
      int aCount = numAmount(a, j);
      answer += aCount * power(10, answerCount);
      answerCount--;
    }
    countFrom = countTo;
    printf("%d\n", answer);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1070 <scanf@plt>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <numLength@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cmp    %ecx,%eax
jge    1251 <main+0x101>
mov    -0x10(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1060 <numAmount@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1060 <numAmount@plt>
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    122e <main+0xde>
mov    -0x8(%rbp),%edi
mov    -0x24(%rbp),%esi
call   1060 <numAmount@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x20(%rbp),%esi
mov    $0xa,%edi
call   1040 <power@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
imul   %ecx,%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11dc <main+0x8c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xdc8(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1188 <main+0x38>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe9e(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1070 <scanf@plt>
mov    (%rsp),%edi
call   1030 <numLength@plt>
test   %eax,%eax
jle    120f <main+0xbf>
xor    %r15d,%r15d
xor    %r12d,%r12d
jmp    11b2 <main+0x62>
nopw   0x0(%rax,%rax,1)
lea    0xe6f(%rip),%rdi
mov    %ebx,%esi
call   1050 <printf@plt>
add    $0x1,%r15d
mov    (%rsp),%edi
call   1030 <numLength@plt>
mov    %r14d,%r12d
cmp    %eax,%r15d
jge    120f <main+0xbf>
mov    (%rsp),%edi
mov    %r15d,%esi
call   1060 <numAmount@plt>
mov    %eax,%r13d
lea    (%r12,%r13,1),%r14d
mov    (%rsp),%edi
mov    %r15d,%esi
call   1060 <numAmount@plt>
mov    $0x0,%ebx
test   %r13d,%r13d
jle    1190 <main+0x40>
mov    %eax,%ebp
add    $0xffffffff,%ebp
xor    %ebx,%ebx
mov    0x4(%rsp),%edi
mov    %r12d,%esi
call   1060 <numAmount@plt>
mov    %eax,%r13d
mov    $0xa,%edi
mov    %ebp,%esi
call   1040 <power@plt>
imul   %r13d,%eax
add    %eax,%ebx
add    $0x1,%r12d
add    $0xffffffff,%ebp
cmp    %r14d,%r12d
jl     11e0 <main+0x90>
jmp    1190 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [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
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
%11 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %12
12: ; preds = %51, %0
%13 = load i32, i32* %6
%14 = load i32, i32* %3
%15 = call i32 @numLength(i32 %14)
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %54
17: ; preds = %12
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = load i32, i32* %6
%21 = call i32 @numAmount(i32 %19, i32 %20)
%22 = add nsw i32 %18, %21
store i32 %22, i32* %5
store i32 0, i32* %7
%23 = load i32, i32* %3
%24 = load i32, i32* %6
%25 = call i32 @numAmount(i32 %23, i32 %24)
%26 = sub nsw i32 %25, 1
store i32 %26, i32* %8
%27 = load i32, i32* %4
store i32 %27, i32* %9
br label %28
28: ; preds = %44, %17
%29 = load i32, i32* %9
%30 = load i32, i32* %5
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %47
32: ; preds = %28
%33 = load i32, i32* %2
%34 = load i32, i32* %9
%35 = call i32 @numAmount(i32 %33, i32 %34)
store i32 %35, i32* %10
%36 = load i32, i32* %10
%37 = load i32, i32* %8
%38 = call i32 @power(i32 10, i32 %37)
%39 = mul nsw i32 %36, %38
%40 = load i32, i32* %7
%41 = add nsw i32 %40, %39
store i32 %41, i32* %7
%42 = load i32, i32* %8
%43 = add nsw i32 %42, -1
store i32 %43, i32* %8
br label %44
44: ; preds = %32
%45 = load i32, i32* %9
%46 = add nsw i32 %45, 1
store i32 %46, i32* %9
br label %28
47: ; preds = %28
%48 = load i32, i32* %5
store i32 %48, i32* %4
%49 = load i32, i32* %7
%50 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %49)
br label %51
51: ; preds = %47
%52 = load i32, i32* %6
%53 = add nsw i32 %52, 1
store i32 %53, i32* %6
br label %12
54: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\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* %2
%7 = call i32 @numLength(i32 %6)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %19, %0
ret i32 0
10: ; preds = %0, %19
%11 = phi i32 [ %22, %19 ], [ 0, %0 ]
%12 = phi i32 [ %15, %19 ], [ 0, %0 ]
%13 = load i32, i32* %2
%14 = call i32 @numAmount(i32 %13, i32 %11)
%15 = add nsw i32 %14, %12
%16 = load i32, i32* %2
%17 = call i32 @numAmount(i32 %16, i32 %11)
%18 = icmp sgt i32 %14, 0
br i1 %18, label %26, label %19
19: ; preds = %26, %10
%20 = phi i32 [ 0, %10 ], [ %35, %26 ]
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = add nuw nsw i32 %11, 1
%23 = load i32, i32* %2
%24 = call i32 @numLength(i32 %23)
%25 = icmp slt i32 %22, %24
br i1 %25, label %10, label %9
26: ; preds = %10, %26
%27 = phi i32 [ %30, %26 ], [ %17, %10 ]
%28 = phi i32 [ %36, %26 ], [ %12, %10 ]
%29 = phi i32 [ %35, %26 ], [ 0, %10 ]
%30 = add nsw i32 %27, -1
%31 = load i32, i32* %1
%32 = call i32 @numAmount(i32 %31, i32 %28)
%33 = call i32 @power(i32 10, i32 %30)
%34 = mul nsw i32 %33, %32
%35 = add nsw i32 %34, %29
%36 = add nsw i32 %28, 1
%37 = icmp slt i32 %36, %15
br i1 %37, label %26, label %19
}