#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 a, sum, d;
  float avr;
  scanf("%d", &a);
  sum = 0;
  do {
    d = a % 10;
    sum = sum + d;
    avr++;
    a = a / 10;
  } while (a != 0);
  avr = (float)sum / avr;
  if (avr > 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)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
movss  0xe9b(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1146 <main+0x26>
cvtsi2ssl -0xc(%rbp),%xmm0
divss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0xe61(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11bd <main+0x9d>
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
jmp    11c9 <main+0xa9>
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%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>
xor    %eax,%eax
mov    0x4(%rsp),%ecx
movss  0xec0(%rip),%xmm1
movslq %ecx,%rdx
imul   $0x66666667,%rdx,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
lea    (%rcx,%rcx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edx,%edi
sub    %esi,%edi
add    %edi,%eax
addss  %xmm1,%xmm0
add    $0x9,%edx
cmp    $0x12,%edx
ja     1140 <main+0x20>
mov    %ecx,0x4(%rsp)
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
divss  %xmm0,%xmm1
ucomiss 0xe7f(%rip),%xmm1
lea    0xe7f(%rip),%rax
lea    0xe7e(%rip),%rdi
cmova  %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 float
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %7
7: ; preds = %17, %0
%8 = load i32, i32* %2
%9 = srem i32 %8, 10
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
store i32 %12, i32* %3
%13 = load float, float* %5
%14 = fadd float %13, 1.000000e+00
store float %14, float* %5
%15 = load i32, i32* %2
%16 = sdiv i32 %15, 10
store i32 %16, i32* %2
br label %17
17: ; preds = %7
%18 = load i32, i32* %2
%19 = icmp ne i32 %18, 0
br i1 %19, label %7, label %20
20: ; preds = %17
%21 = load i32, i32* %3
%22 = sitofp i32 %21 to float
%23 = load float, float* %5
%24 = fdiv float %22, %23
store float %24, float* %5
%25 = load float, float* %5
%26 = fcmp ogt float %25, 7.000000e+00
br i1 %26, label %27, label %29
27: ; preds = %20
%28 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %31
29: ; preds = %20
%30 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %29, %27
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 ], [ %12, %5 ]
%7 = phi i32 [ 0, %0 ], [ %10, %5 ]
%8 = phi float [ undef, %0 ], [ %11, %5 ]
%9 = srem i32 %6, 10
%10 = add nsw i32 %9, %7
%11 = fadd float %8, 1.000000e+00
%12 = sdiv i32 %6, 10
%13 = add i32 %6, 9
%14 = icmp ult i32 %13, 19
br i1 %14, label %15, label %5
15: ; preds = %5
store i32 %12, i32* %1
%16 = sitofp i32 %10 to float
%17 = fdiv float %16, %11
%18 = fcmp ogt float %17, 7.000000e+00
%19 = select i1 %18, 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)
%20 = call i32 @printf(i8* dereferenceable(1) %19)
ret i32 0
}