#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, int, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, ge, shi, bai, qian, wang;
  scanf("%d", &a);
  ge = a % 10;
  shi = (a / 10) % 10;
  bai = (a / 100) % 10;
  qian = (a / 1000) % 10;
  wang = (a / 10000) % 10;
  printf("%d %d %d %d %d", wang, qian, bai, shi, ge);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0xc(%rbp),%r9d
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%r8
imul   $0x66666667,%r8,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,1),%edx
lea    (%rdx,%rdx,4),%edx
imul   $0x51eb851f,%r8,%rsi
imul   $0x10624dd3,%r8,%rdi
imul   $0x68db8bad,%r8,%rax
mov    %r8d,%r9d
sub    %edx,%r9d
movslq %ecx,%r8
imul   $0x66666667,%r8,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%r8d
mov    %rsi,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rsi
add    %ecx,%esi
movslq %esi,%rcx
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdx
add    %esi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rdi
add    %edx,%edi
movslq %edi,%rdx
imul   $0x66666667,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rsi
add    %edi,%esi
add    %esi,%esi
lea    (%rsi,%rsi,4),%esi
sub    %esi,%edx
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x2c,%rax
add    %esi,%eax
movslq %eax,%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rax
add    %edi,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
lea    0xded(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [15 x i8] c"%d %d %d %d %d\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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = srem i32 %9, 10
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 10
%13 = srem i32 %12, 10
store i32 %13, i32* %4
%14 = load i32, i32* %2
%15 = sdiv i32 %14, 100
%16 = srem i32 %15, 10
store i32 %16, i32* %5
%17 = load i32, i32* %2
%18 = sdiv i32 %17, 1000
%19 = srem i32 %18, 10
store i32 %19, i32* %6
%20 = load i32, i32* %2
%21 = sdiv i32 %20, 10000
%22 = srem i32 %21, 10
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = load i32, i32* %5
%26 = load i32, i32* %4
%27 = load i32, i32* %3
%28 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %23, i32 %24, i32 %25, i32 %26, i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [15 x i8] c"%d %d %d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = srem i32 %4, 10
%6 = sdiv i32 %4, 10
%7 = srem i32 %6, 10
%8 = sdiv i32 %4, 100
%9 = srem i32 %8, 10
%10 = sdiv i32 %4, 1000
%11 = srem i32 %10, 10
%12 = sdiv i32 %4, 10000
%13 = srem i32 %12, 10
%14 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %11, i32 %9, i32 %7, i32 %5)
ret i32 0
}