#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 *);
int main() {
  int s, v1, v2;
  scanf("%d %d %d", &s, &v1, &v2);
  if (v1 < v2)
    v1 ^= v2 ^= v1 ^= v2;
  int found = 0;
  for (int i = s / v1; i >= 0; i--) {
    int rem = s - i * v1;
    if (rem % v2 == 0) {
      printf("%d %d\n", i, rem / v2);
      found = 1;
      break;
    }
  }
  if (!found)
    printf("Impossible\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1168 <main+0x48>
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     11db <main+0xbb>
mov    -0x8(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   -0xc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    11c8 <main+0xa8>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,%edx
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    11db <main+0xbb>
jmp    11cd <main+0xad>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1179 <main+0x59>
cmpl   $0x0,-0x14(%rbp)
jne    11f3 <main+0xd3>
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x10(%rsp),%eax
mov    0xc(%rsp),%edi
cmp    %edi,%eax
jge    1168 <main+0x38>
mov    %eax,0xc(%rsp)
mov    %edi,0x10(%rsp)
mov    %eax,%r8d
jmp    116d <main+0x3d>
mov    %edi,%r8d
mov    %eax,%edi
mov    0x14(%rsp),%ecx
mov    %ecx,%eax
cltd
idiv   %edi
test   %eax,%eax
js     11a5 <main+0x75>
mov    %eax,%esi
imul   %edi,%eax
sub    %eax,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ecx,%eax
cltd
idiv   %r8d
test   %edx,%edx
je     11b3 <main+0x83>
lea    -0x1(%rsi),%eax
add    %edi,%ecx
test   %esi,%esi
mov    %eax,%esi
jg     1190 <main+0x60>
lea    0xe64(%rip),%rdi
call   1030 <puts@plt>
jmp    11c3 <main+0x93>
lea    0xe4f(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

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