#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 int *);
int main() {
  unsigned int n;
  scanf("%u", &n);
  int last_digit, sum = 0, length = 0;
  while (n > 0) {
    last_digit = n % 10;
    sum += last_digit;
    length++;
    n /= 10;
  }
  float avg = (float)sum / length;
  printf(avg > 7.0 ? "heavy\n" : "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>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    118c <main+0x6c>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x2d>
cvtsi2ssl -0x10(%rbp),%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe50(%rip),%xmm1
lea    0xe5b(%rip),%rdi
lea    0xe4d(%rip),%rax
ucomisd %xmm1,%xmm0
cmova  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
je     11a7 <main+0x87>
pxor   %xmm0,%xmm0
mov    $0xcccccccd,%ecx
movaps 0xeb6(%rip),%xmm1
nopw   0x0(%rax,%rax,1)
mov    %eax,%edx
mov    %eax,%eax
imul   %rcx,%rax
shr    $0x23,%rax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edx,%edi
sub    %esi,%edi
movd   %edi,%xmm2
movaps %xmm1,%xmm3
movss  %xmm2,%xmm3
paddd  %xmm3,%xmm0
cmp    $0x9,%edx
ja     1150 <main+0x30>
mov    %eax,0x4(%rsp)
cvtdq2ps %xmm0,%xmm0
movaps %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm1
divss  %xmm1,%xmm0
ucomiss 0xe7d(%rip),%xmm0
lea    0xe7d(%rip),%rax
lea    0xe7d(%rip),%rdi
cmova  %rax,%rdi
jmp    11ae <main+0x8e>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\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 i32
%5 = alloca i32
%6 = alloca float
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %4
store i32 0, i32* %5
br label %8
8: ; preds = %11, %0
%9 = load i32, i32* %2
%10 = icmp ugt i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = load i32, i32* %2
%13 = urem i32 %12, 10
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, %14
store i32 %16, i32* %4
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
%19 = load i32, i32* %2
%20 = udiv i32 %19, 10
store i32 %20, i32* %2
br label %8
21: ; preds = %8
%22 = load i32, i32* %4
%23 = sitofp i32 %22 to float
%24 = load i32, i32* %5
%25 = sitofp i32 %24 to float
%26 = fdiv float %23, %25
store float %26, float* %6
%27 = load float, float* %6
%28 = fpext float %27 to double
%29 = fcmp ogt double %28, 7.000000e+00
%30 = zext i1 %29 to i64
%31 = select i1 %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%32 = call i32 @printf(i8* %31)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\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 = 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 eq i32 %4, 0
br i1 %5, label %21, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %12, %6 ], [ %4, %0 ]
%8 = phi <2 x i32> [ %11, %6 ], [ zeroinitializer, %0 ]
%9 = urem i32 %7, 10
%10 = insertelement <2 x i32> <i32 poison, i32 1>, i32 %9, i64 0
%11 = add nuw nsw <2 x i32> %8, %10
%12 = udiv i32 %7, 10
%13 = icmp ult i32 %7, 10
br i1 %13, label %14, label %6
14: ; preds = %6
store i32 %12, i32* %1
%15 = sitofp <2 x i32> %11 to <2 x float>
%16 = extractelement <2 x float> %15, i64 0
%17 = extractelement <2 x float> %15, i64 1
%18 = fdiv float %16, %17
%19 = fcmp ogt float %18, 7.000000e+00
%20 = select i1 %19, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
br label %21
21: ; preds = %14, %0
%22 = phi i8* [ %20, %14 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), %0 ]
%23 = call i32 @printf(i8* dereferenceable(1) %22)
ret i32 0
}