#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;
  int sum = 0;
  int length = 0;
  float avg;
  scanf("%d", &n);
  while (n > 0) {
    sum += n % 10;
    length++;
    n /= 10;
  }
  avg = sum / length;
  if (avg > 7.0) {
    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)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1184 <main+0x64>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x2d>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe5b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11c0 <main+0xa0>
lea    0xe55(%rip),%rdi
call   1030 <printf@plt>
jmp    11cc <main+0xac>
lea    0xe4b(%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>
mov    0x4(%rsp),%edx
test   %edx,%edx
jle    1192 <main+0x72>
xor    %eax,%eax
mov    $0xcccccccd,%r8d
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%r9d
mov    %edx,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %r9d,%edi
sub    %esi,%edi
add    %edi,%eax
add    $0x1,%ecx
cmp    $0x9,%r9d
ja     1150 <main+0x30>
mov    %edx,0x4(%rsp)
xor    %edx,%edx
div    %ecx
cmp    $0x8,%eax
lea    0xe84(%rip),%rax
lea    0xe77(%rip),%rdi
cmovae %rax,%rdi
jmp    1199 <main+0x79>
lea    0xe70(%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 i32
%5 = alloca float
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %7
7: ; preds = %10, %0
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32, i32* %2
%12 = srem i32 %11, 10
%13 = load i32, i32* %3
%14 = add nsw i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
%17 = load i32, i32* %2
%18 = sdiv i32 %17, 10
store i32 %18, i32* %2
br label %7
19: ; preds = %7
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = sdiv i32 %20, %21
%23 = sitofp i32 %22 to float
store float %23, float* %5
%24 = load float, float* %5
%25 = fpext float %24 to double
%26 = fcmp ogt double %25, 7.000000e+00
br i1 %26, label %27, label %29
27: ; preds = %19
%28 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %31
29: ; preds = %19
%30 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 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 = [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, 0
br i1 %5, label %6, label %19
6: ; preds = %0, %6
%7 = phi i32 [ %11, %6 ], [ 0, %0 ]
%8 = phi i32 [ %12, %6 ], [ 0, %0 ]
%9 = phi i32 [ %13, %6 ], [ %4, %0 ]
%10 = urem i32 %9, 10
%11 = add nuw nsw i32 %7, %10
%12 = add nuw nsw i32 %8, 1
%13 = udiv i32 %9, 10
%14 = icmp ult i32 %9, 10
br i1 %14, label %15, label %6
15: ; preds = %6
store i32 %13, i32* %1
%16 = udiv i32 %11, %12
%17 = icmp ugt i32 %16, 7
%18 = select i1 %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0)
br label %19
19: ; preds = %15, %0
%20 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0), %0 ], [ %18, %15 ]
%21 = call i32 @puts(i8* dereferenceable(1) %20)
ret i32 0
}