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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x10(%rbp),%edx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    114d <main+0x2d>
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x7,-0x10(%rbp)
jg     11a6 <main+0x86>
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
jmp    11b2 <main+0x92>
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%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
add    $0x9,%esi
cmp    $0x12,%esi
ja     1140 <main+0x20>
mov    %edx,0x4(%rsp)
cltd
idiv   %ecx
cmp    $0x8,%eax
lea    0xe89(%rip),%rax
lea    0xe7b(%rip),%rdi
cmovl  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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