#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 = 0, n, count = 0;
  scanf("%d", &a);
  while (a < 1 || a > 9999)
    scanf("%d", &a);
  while (a != 0) {
    n = a % 10;
    sum += n;
    count++;
    a /= 10;
  }
  if (sum / count > 7)
    printf("heavy");
  else if (sum / count <= 7)
    printf("light");
  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,-0x14(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x15(%rbp)
jl     1169 <main+0x49>
cmpl   $0x270f,-0x8(%rbp)
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1179 <main+0x59>
jmp    118e <main+0x6e>
lea    0xe80(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    114d <main+0x2d>
jmp    1193 <main+0x73>
cmpl   $0x0,-0x8(%rbp)
je     11d0 <main+0xb0>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1193 <main+0x73>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x7,%eax
jle    11f1 <main+0xd1>
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
jmp    1212 <main+0xf2>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x7,%eax
jg     120d <main+0xed>
lea    0xe01(%rip),%rdi
call   1030 <printf@plt>
jmp    1212 <main+0xf2>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
lea    -0x2710(%rcx),%eax
cmp    $0xffffd8f0,%eax
ja     117c <main+0x5c>
lea    0xeb3(%rip),%r14
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
lea    -0x2710(%rcx),%eax
cmp    $0xffffd8f1,%eax
jb     1160 <main+0x40>
xor    %esi,%esi
xor    %eax,%eax
movslq %ecx,%rdx
imul   $0x66666667,%rdx,%rcx
mov    %rcx,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rcx
add    %edi,%ecx
lea    (%rcx,%rcx,1),%edi
lea    (%rdi,%rdi,4),%edi
mov    %edx,%ebx
sub    %edi,%ebx
add    %ebx,%eax
add    $0x1,%esi
add    $0x9,%edx
cmp    $0x12,%edx
ja     1180 <main+0x60>
mov    %ecx,0x4(%rsp)
cltd
idiv   %esi
cmp    $0x8,%eax
lea    0xe44(%rip),%rax
lea    0xe43(%rip),%rdi
cmovge %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
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 i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %5
%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 = %15, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 1
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 9999
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ true, %7 ], [ %12, %10 ]
br i1 %14, label %15, label %17
15: ; preds = %13
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %7
17: ; preds = %13
br label %18
18: ; preds = %21, %17
%19 = load i32, i32* %2
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %31
21: ; preds = %18
%22 = load i32, i32* %2
%23 = srem i32 %22, 10
store i32 %23, i32* %4
%24 = load i32, i32* %4
%25 = load i32, i32* %3
%26 = add nsw i32 %25, %24
store i32 %26, i32* %3
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
%29 = load i32, i32* %2
%30 = sdiv i32 %29, 10
store i32 %30, i32* %2
br label %18
31: ; preds = %18
%32 = load i32, i32* %3
%33 = load i32, i32* %5
%34 = sdiv i32 %32, %33
%35 = icmp sgt i32 %34, 7
br i1 %35, label %36, label %38
36: ; preds = %31
%37 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %46
38: ; preds = %31
%39 = load i32, i32* %3
%40 = load i32, i32* %5
%41 = sdiv i32 %39, %40
%42 = icmp sle i32 %41, 7
br i1 %42, label %43, label %45
43: ; preds = %38
%44 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %45
45: ; preds = %43, %38
br label %46
46: ; preds = %45, %36
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
%5 = add i32 %4, -10000
%6 = icmp ult i32 %5, -9999
br i1 %6, label %7, label %12
7: ; preds = %0, %7
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
%10 = add i32 %9, -10000
%11 = icmp ult i32 %10, -9999
br i1 %11, label %7, label %12
12: ; preds = %7, %0
%13 = phi i32 [ %4, %0 ], [ %9, %7 ]
br label %14
14: ; preds = %12, %14
%15 = phi i32 [ %20, %14 ], [ 0, %12 ]
%16 = phi i32 [ %19, %14 ], [ 0, %12 ]
%17 = phi i32 [ %21, %14 ], [ %13, %12 ]
%18 = srem i32 %17, 10
%19 = add nsw i32 %16, %18
%20 = add nuw nsw i32 %15, 1
%21 = sdiv i32 %17, 10
%22 = add nsw i32 %17, 9
%23 = icmp ult i32 %22, 19
br i1 %23, label %24, label %14
24: ; preds = %14
store i32 %21, i32* %1
%25 = sdiv i32 %19, %20
%26 = icmp sgt i32 %25, 7
%27 = select i1 %26, 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)
%28 = call i32 @printf(i8* dereferenceable(1) %27)
ret i32 0
}