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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%eax
add    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     114d <main+0x2d>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe61(%rip),%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    11ba <main+0x9a>
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
jmp    11c6 <main+0xa6>
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    %ecx,%ecx
mov    0x4(%rsp),%edx
xor    %eax,%eax
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),%r8d
mov    %esi,%edi
sub    %r8d,%edi
add    %edi,%eax
add    $0x1,%ecx
cmp    $0x9,%esi
jg     1140 <main+0x20>
mov    %edx,0x4(%rsp)
cltd
idiv   %ecx
cmp    $0x7,%eax
lea    0xe85(%rip),%rax
lea    0xe86(%rip),%rdi
cmovl  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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