#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, s;
  float i;
  scanf("%d", &n);
  for (; n / 10 > 0; i++) {
    s = s + n % 10;
    n = n / 10;
  }
  if (s / i > 7) {
    printf("heavy\n");
  } else {
    printf("light\n");
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
jle    1191 <main+0x71>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
add    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
movss  0xe82(%rip),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    113f <main+0x1f>
cvtsi2ssl -0xc(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
movss  0xe5d(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11bd <main+0x9d>
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
jmp    11d0 <main+0xb0>
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0xa,%eax
jl     1192 <main+0x72>
mov    $0xcccccccd,%r8d
movss  0xeb7(%rip),%xmm1
nopl   0x0(%rax)
mov    %eax,%ecx
mov    %eax,%eax
imul   %r8,%rax
shr    $0x23,%rax
lea    (%rax,%rax,1),%edi
lea    (%rdi,%rdi,4),%edi
mov    %ecx,%esi
sub    %edi,%esi
add    %esi,%edx
addss  %xmm1,%xmm0
cmp    $0x63,%ecx
ja     1150 <main+0x30>
mov    %eax,0x4(%rsp)
xorps  %xmm1,%xmm1
cvtsi2ss %edx,%xmm1
divss  %xmm0,%xmm1
ucomiss 0xe7d(%rip),%xmm1
jbe    1192 <main+0x72>
lea    0xe81(%rip),%rdi
jmp    1199 <main+0x79>
lea    0xe72(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"heavy\0A\00"
@.str.2 = [7 x i8] c"light\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %6
6: ; preds = %17, %0
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 10
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = srem i32 %12, 10
%14 = add nsw i32 %11, %13
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = sdiv i32 %15, 10
store i32 %16, i32* %2
br label %17
17: ; preds = %10
%18 = load float, float* %4
%19 = fadd float %18, 1.000000e+00
store float %19, float* %4
br label %6
20: ; preds = %6
%21 = load i32, i32* %3
%22 = sitofp i32 %21 to float
%23 = load float, float* %4
%24 = fdiv float %22, %23
%25 = fcmp ogt float %24, 7.000000e+00
br i1 %25, label %26, label %28
26: ; preds = %20
%27 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %30
28: ; preds = %20
%29 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %30
30: ; preds = %28, %26
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [6 x i8] c"light\00"
@str.3 = [6 x i8] c"heavy\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 = icmp sgt i32 %4, 9
br i1 %5, label %6, label %19
6: ; preds = %0, %6
%7 = phi float [ %13, %6 ], [ undef, %0 ]
%8 = phi i32 [ %12, %6 ], [ undef, %0 ]
%9 = phi i32 [ %10, %6 ], [ %4, %0 ]
%10 = udiv i32 %9, 10
%11 = urem i32 %9, 10
%12 = add nsw i32 %8, %11
%13 = fadd float %7, 1.000000e+00
%14 = icmp ugt i32 %9, 99
br i1 %14, label %6, label %15
15: ; preds = %6
store i32 %10, i32* %1
%16 = sitofp i32 %12 to float
%17 = fdiv float %16, %13
%18 = fcmp ogt float %17, 7.000000e+00
br i1 %18, label %20, label %19
19: ; preds = %0, %15
br label %20
20: ; preds = %15, %19
%21 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), %19 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0), %15 ]
%22 = call i32 @puts(i8* dereferenceable(1) %21)
ret i32 0
}