#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 *, unsigned long long *);
int main() {
  unsigned long long int n;
  scanf("%llu", &n);
  char ans[5000];
  int i = 0;
  while (n) {
    if (n & 1)
      ans[i++] = '5';
    else
      ans[i++] = '6';
    n = (n - 1) / 2;
  }
  for (i--; i >= 0; i--) {
    printf("%c", ans[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x13b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x13a4(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11b9 <main+0x99>
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1189 <main+0x69>
mov    -0x13a4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x13a4(%rbp)
cltq
movb   $0x35,-0x13a0(%rbp,%rax,1)
35
jmp    11a4 <main+0x84>
mov    -0x13a4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x13a4(%rbp)
cltq
movb   $0x36,-0x13a0(%rbp,%rax,1)
36
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    114c <main+0x2c>
mov    -0x13a4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x13a4(%rbp)
cmpl   $0x0,-0x13a4(%rbp)
jl     1206 <main+0xe6>
movslq -0x13a4(%rbp),%rax
movsbl -0x13a0(%rbp,%rax,1),%esi
ff
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x13a4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x13a4(%rbp)
jmp    11c8 <main+0xa8>
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x13b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x13a0,%rsp
lea    0xed1(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%rcx
test   %rcx,%rcx
je     11a7 <main+0x87>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,%rdx
and    $0x1,%cl
mov    $0x36,%bl
sub    %cl,%bl
mov    %bl,0x10(%rsp,%rax,1)
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
mov    %rdx,%rcx
shr    %rcx
cmp    $0x2,%rdx
jae    1150 <main+0x30>
mov    %rcx,0x8(%rsp)
test   %eax,%eax
jle    11a7 <main+0x87>
mov    %eax,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
movsbl 0x10(%rsp,%rax,1),%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1190 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x13a0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%llu\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca [5000 x i8]
%3 = bitcast i64* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%5 = getelementptr inbounds [5000 x i8], [5000 x i8]* %2, i64 0, i64 0
%6 = load i64, i64* %1
%7 = icmp eq i64 %6, 0
br i1 %7, label %33, label %13
8: ; preds = %13
%9 = trunc i64 %20 to i32
store i64 %22, i64* %1
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %33
11: ; preds = %8
%12 = and i64 %20, 4294967295
br label %24
13: ; preds = %0, %13
%14 = phi i64 [ %20, %13 ], [ 0, %0 ]
%15 = phi i64 [ %22, %13 ], [ %6, %0 ]
%16 = and i64 %15, 1
%17 = icmp eq i64 %16, 0
%18 = select i1 %17, i8 54, i8 53
%19 = getelementptr inbounds [5000 x i8], [5000 x i8]* %2, i64 0, i64 %14
store i8 %18, i8* %19
%20 = add nuw i64 %14, 1
%21 = add i64 %15, -1
%22 = lshr i64 %21, 1
%23 = icmp ult i64 %21, 2
br i1 %23, label %8, label %13
24: ; preds = %11, %24
%25 = phi i64 [ %12, %11 ], [ %26, %24 ]
%26 = add nsw i64 %25, -1
%27 = and i64 %26, 4294967295
%28 = getelementptr inbounds [5000 x i8], [5000 x i8]* %2, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = call i32 @putchar(i32 %30)
%32 = icmp ugt i64 %25, 1
br i1 %32, label %24, label %33
33: ; preds = %24, %0, %8
%34 = call i32 @putchar(i32 10)
ret i32 0
}