#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 main() {
  int n, i, c, result, avg;
  result = 0;
  i = 0;
  scanf("%d", &n);
  do {
    c = n % 10;
    result = result + c;
    n = n / 10;
    i++;
  } while (n % 10 != 0);
  avg = result / i;
  if (avg > 7)
    printf("heavy");
  else
    printf("light");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114d <main+0x2d>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x18(%rbp)
cmpl   $0x7,-0x18(%rbp)
jle    11b4 <main+0x94>
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
jmp    11c0 <main+0xa0>
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
mov    0x4(%rsp),%edx
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movslq %edx,%rsi
imul   $0x66666667,%rsi,%rdx
mov    %rdx,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rdx
add    %edi,%edx
lea    (%rdx,%rdx,1),%edi
lea    (%rdi,%rdi,4),%edi
sub    %edi,%esi
add    %esi,%eax
add    $0x1,%ecx
imul   $0xcccccccd,%edx,%esi
add    $0x19999998,%esi
ror    %esi
cmp    $0x19999998,%esi
ja     1140 <main+0x20>
mov    %edx,0x4(%rsp)
cltd
idiv   %ecx
cmp    $0x8,%eax
lea    0xe78(%rip),%rax
lea    0xe77(%rip),%rdi
cmovge %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"heavy\00"
@.str.2 = [6 x i8] c"light\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
br label %5
5: ; preds = %5, %0
%6 = phi i32 [ %4, %0 ], [ %11, %5 ]
%7 = phi i32 [ 0, %0 ], [ %10, %5 ]
%8 = phi i32 [ 0, %0 ], [ %12, %5 ]
%9 = srem i32 %6, 10
%10 = add nsw i32 %9, %7
%11 = sdiv i32 %6, 10
%12 = add nuw nsw i32 %8, 1
%13 = srem i32 %11, 10
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5
store i32 %11, i32* %1
%16 = sdiv i32 %10, %12
%17 = icmp sgt i32 %16, 7
%18 = select i1 %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%19 = call i32 @printf(i8* dereferenceable(1) %18)
ret i32 0
}