#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);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int n, j, m;
  int cont = 0;
  int i = 1;
  scanf("%d %d %d", &n, &j, &m);
  while (cont < n) {
    if (i % m == j % m) {
      printf("%d\n", i);
      cont++;
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a5 <main+0x85>
mov    -0x18(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %edx,%eax
mov    -0x1c(%rbp),%edx
cmp    %eax,%edx
jne    1197 <main+0x77>
mov    -0x18(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1155 <main+0x35>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
jle    1190 <main+0x70>
xor    %ebp,%ebp
mov    $0x1,%ebx
lea    0xeb0(%rip),%r14
jmp    1167 <main+0x47>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    %esi,%ebp
jge    1190 <main+0x70>
mov    0x8(%rsp),%edi
mov    %ebx,%eax
cltd
idiv   %edi
mov    %edx,%ecx
mov    0xc(%rsp),%eax
cltd
idiv   %edi
cmp    %edx,%ecx
jne    1160 <main+0x40>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
mov    0x4(%rsp),%esi
jmp    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %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
store i32 0, i32* %1
store i32 0, i32* %5
store i32 1, i32* %6
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
br label %8
8: ; preds = %25, %0
%9 = load i32, i32* %5
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %28
12: ; preds = %8
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = srem i32 %13, %14
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = srem i32 %16, %17
%19 = icmp eq i32 %15, %18
br i1 %19, label %20, label %25
20: ; preds = %12
%21 = load i32, i32* %6
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %25
25: ; preds = %20, %12
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %8
28: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %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 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %28
10: ; preds = %0, %23
%11 = phi i32 [ %24, %23 ], [ %8, %0 ]
%12 = phi i32 [ %26, %23 ], [ 1, %0 ]
%13 = phi i32 [ %25, %23 ], [ 0, %0 ]
%14 = load i32, i32* %3
%15 = srem i32 %12, %14
%16 = load i32, i32* %2
%17 = srem i32 %16, %14
%18 = icmp eq i32 %15, %17
br i1 %18, label %19, label %23
19: ; preds = %10
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%21 = add nsw i32 %13, 1
%22 = load i32, i32* %1
br label %23
23: ; preds = %19, %10
%24 = phi i32 [ %22, %19 ], [ %11, %10 ]
%25 = phi i32 [ %21, %19 ], [ %13, %10 ]
%26 = add nuw nsw i32 %12, 1
%27 = icmp slt i32 %25, %24
br i1 %27, label %10, label %28
28: ; preds = %23, %0
ret i32 0
}