#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 scanf(char *, char *);
int strlen(char *);
int main() {
  char str[100001];
  int i, s4, s15, s100, s400, s55, len, a = 0;
  while (scanf("%s", str) == 1) {
    if (a > 0)
      printf("\n");
    a++;
    s4 = 0, s15 = 0, s100 = 0, s400 = 0, s55 = 0;
    len = strlen(str);
    for (i = 0; i < len; i++) {
      s4 = (s4 * 10 + str[i] - '0') % 4;
      s15 = (s15 * 10 + str[i] - '0') % 15;
      s55 = (s55 * 10 + str[i] - '0') % 55;
      s100 = (s100 * 10 + str[i] - '0') % 100;
      s400 = (s400 * 10 + str[i] - '0') % 400;
    }
    if ((!s4 && s100) || !s400) {
      printf("This is leap year.\n");
      if (!s15)
        printf("This is huluculu festival year.\n");
      if (!s55)
        printf("This is bulukulu festival year.\n");
    } else {
      if (!s15)
        printf("This is huluculu festival year.\n");
      else
        printf("This is an ordinary year.\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186d0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x186d0(%rbp)
lea    -0x186b0(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    136f <main+0x23f>
cmpl   $0x0,-0x186d0(%rbp)
jle    1181 <main+0x51>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    -0x186d0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x186d0(%rbp)
movl   $0x0,-0x186b8(%rbp)
movl   $0x0,-0x186bc(%rbp)
movl   $0x0,-0x186c0(%rbp)
movl   $0x0,-0x186c4(%rbp)
movl   $0x0,-0x186c8(%rbp)
lea    -0x186b0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x186cc(%rbp)
movl   $0x0,-0x186b4(%rbp)
mov    -0x186b4(%rbp),%eax
cmp    -0x186cc(%rbp),%eax
jge    12d1 <main+0x1a1>
imul   $0xa,-0x186b8(%rbp),%eax
movslq -0x186b4(%rbp),%rcx
movsbl -0x186b0(%rbp,%rcx,1),%ecx
ff
add    %ecx,%eax
sub    $0x30,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0x186b8(%rbp)
imul   $0xa,-0x186bc(%rbp),%eax
movslq -0x186b4(%rbp),%rcx
movsbl -0x186b0(%rbp,%rcx,1),%ecx
ff
add    %ecx,%eax
sub    $0x30,%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
mov    %edx,-0x186bc(%rbp)
imul   $0xa,-0x186c8(%rbp),%eax
movslq -0x186b4(%rbp),%rcx
movsbl -0x186b0(%rbp,%rcx,1),%ecx
ff
add    %ecx,%eax
sub    $0x30,%eax
mov    $0x37,%ecx
cltd
idiv   %ecx
mov    %edx,-0x186c8(%rbp)
imul   $0xa,-0x186c0(%rbp),%eax
movslq -0x186b4(%rbp),%rcx
movsbl -0x186b0(%rbp,%rcx,1),%ecx
ff
add    %ecx,%eax
sub    $0x30,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x186c0(%rbp)
imul   $0xa,-0x186c4(%rbp),%eax
movslq -0x186b4(%rbp),%rcx
movsbl -0x186b0(%rbp,%rcx,1),%ecx
ff
add    %ecx,%eax
sub    $0x30,%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %edx,-0x186c4(%rbp)
mov    -0x186b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x186b4(%rbp)
jmp    11de <main+0xae>
cmpl   $0x0,-0x186b8(%rbp)
jne    12eb <main+0x1bb>
cmpl   $0x0,-0x186c0(%rbp)
jne    12f8 <main+0x1c8>
cmpl   $0x0,-0x186c4(%rbp)
jne    133b <main+0x20b>
lea    0xd04(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0x186bc(%rbp)
jne    131d <main+0x1ed>
lea    0xcff(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0x186c8(%rbp)
jne    1336 <main+0x206>
lea    0xd07(%rip),%rdi
call   1040 <printf@plt>
jmp    136a <main+0x23a>
cmpl   $0x0,-0x186bc(%rbp)
jne    1359 <main+0x229>
lea    0xcc8(%rip),%rdi
call   1040 <printf@plt>
jmp    1365 <main+0x235>
lea    0xcf9(%rip),%rdi
call   1040 <printf@plt>
jmp    136a <main+0x23a>
jmp    114c <main+0x1c>
xor    %eax,%eax
add    $0x186d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x186a8,%rsp
lea    0xea8(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    1320 <main+0x1e0>
xor    %r12d,%r12d
mov    %rsp,%r14
jmp    11b6 <main+0x76>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   %r13d,%r13d
lea    0xecc(%rip),%rdi
lea    0xea5(%rip),%rax
cmove  %rax,%rdi
call   1040 <puts@plt>
add    $0x1,%r12d
lea    0xe5b(%rip),%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    1320 <main+0x1e0>
test   %r12d,%r12d
je     11c5 <main+0x85>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    12f0 <main+0x1b0>
mov    %eax,%r8d
xor    %edx,%edx
xor    %r15d,%r15d
xor    %eax,%eax
xor    %esi,%esi
xor    %r13d,%r13d
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
lea    (%rdi,%rdi,4),%ebp
movsbl (%rsp,%rdx,1),%ebx
lea    (%rbx,%rbp,2),%edi
add    $0xffffffd0,%edi
lea    (%rbx,%rbp,2),%ebp
add    $0xffffffd3,%ebp
test   %edi,%edi
cmovns %edi,%ebp
and    $0xfffffffc,%ebp
sub    %ebp,%edi
lea    0x0(%r13,%r13,4),%ebp
lea    (%rbx,%rbp,2),%ebp
add    $0xffffffd0,%ebp
movslq %ebp,%r13
imul   $0xffffffff88888889,%r13,%rbp
shr    $0x20,%rbp
add    %r13d,%ebp
mov    %ebp,%ecx
shr    $0x1f,%ecx
sar    $0x3,%ebp
add    %ecx,%ebp
lea    0x0(%rbp,%rbp,4),%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%r13d
lea    (%r15,%r15,4),%ecx
lea    (%rbx,%rcx,2),%ecx
add    $0xffffffd0,%ecx
movslq %ecx,%r15
imul   $0x94f2095,%r15,%rcx
mov    %rcx,%rbp
shr    $0x3f,%rbp
sar    $0x21,%rcx
add    %ebp,%ecx
imul   $0x37,%ecx,%ecx
sub    %ecx,%r15d
lea    (%rsi,%rsi,4),%ecx
lea    (%rbx,%rcx,2),%ecx
add    $0xffffffd0,%ecx
movslq %ecx,%rsi
imul   $0x51eb851f,%rsi,%rcx
mov    %rcx,%rbp
shr    $0x3f,%rbp
sar    $0x25,%rcx
add    %ebp,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%esi
lea    (%rax,%rax,4),%eax
lea    (%rbx,%rax,2),%eax
add    $0xffffffd0,%eax
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rbp
shr    $0x3f,%rbp
sar    $0x27,%rcx
add    %ebp,%ecx
imul   $0x190,%ecx,%ecx
sub    %ecx,%eax
add    $0x1,%rdx
cmp    %rdx,%r8
jne    11f0 <main+0xb0>
test   %edi,%edi
setne  %cl
test   %esi,%esi
sete   %dl
or     %cl,%dl
cmp    $0x1,%dl
jne    12d6 <main+0x196>
test   %eax,%eax
jne    1180 <main+0x40>
lea    0xd26(%rip),%rdi
call   1040 <puts@plt>
test   %r13d,%r13d
jne    130b <main+0x1cb>
jmp    12ff <main+0x1bf>
nopl   0x0(%rax)
lea    0xd0c(%rip),%rdi
call   1040 <puts@plt>
xor    %r15d,%r15d
lea    0xd30(%rip),%rdi
call   1040 <puts@plt>
lea    0xd04(%rip),%rdi
test   %r15d,%r15d
jne    119a <main+0x5a>
jmp    1195 <main+0x55>
xor    %eax,%eax
add    $0x186a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [20 x i8] c"This is leap year.\0A\00"
@.str.3 = [33 x i8] c"This is huluculu festival year.\0A\00"
@.str.4 = [33 x i8] c"This is bulukulu festival year.\0A\00"
@.str.5 = [27 x i8] c"This is an ordinary year.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100001 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %10
br label %11
11: ; preds = %112, %0
%12 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 0
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %113
15: ; preds = %11
%16 = load i32, i32* %10
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
%21 = load i32, i32* %10
%22 = add nsw i32 %21, 1
store i32 %22, i32* %10
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
%23 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 0
%24 = call i32 @strlen(i8* %23)
store i32 %24, i32* %9
store i32 0, i32* %3
br label %25
25: ; preds = %80, %20
%26 = load i32, i32* %3
%27 = load i32, i32* %9
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %83
29: ; preds = %25
%30 = load i32, i32* %4
%31 = mul nsw i32 %30, 10
%32 = load i32, i32* %3
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = add nsw i32 %31, %36
%38 = sub nsw i32 %37, 48
%39 = srem i32 %38, 4
store i32 %39, i32* %4
%40 = load i32, i32* %5
%41 = mul nsw i32 %40, 10
%42 = load i32, i32* %3
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = add nsw i32 %41, %46
%48 = sub nsw i32 %47, 48
%49 = srem i32 %48, 15
store i32 %49, i32* %5
%50 = load i32, i32* %8
%51 = mul nsw i32 %50, 10
%52 = load i32, i32* %3
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 %53
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = add nsw i32 %51, %56
%58 = sub nsw i32 %57, 48
%59 = srem i32 %58, 55
store i32 %59, i32* %8
%60 = load i32, i32* %6
%61 = mul nsw i32 %60, 10
%62 = load i32, i32* %3
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 %63
%65 = load i8, i8* %64
%66 = sext i8 %65 to i32
%67 = add nsw i32 %61, %66
%68 = sub nsw i32 %67, 48
%69 = srem i32 %68, 100
store i32 %69, i32* %6
%70 = load i32, i32* %7
%71 = mul nsw i32 %70, 10
%72 = load i32, i32* %3
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 %73
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = add nsw i32 %71, %76
%78 = sub nsw i32 %77, 48
%79 = srem i32 %78, 400
store i32 %79, i32* %7
br label %80
80: ; preds = %29
%81 = load i32, i32* %3
%82 = add nsw i32 %81, 1
store i32 %82, i32* %3
br label %25
83: ; preds = %25
%84 = load i32, i32* %4
%85 = icmp ne i32 %84, 0
br i1 %85, label %89, label %86
86: ; preds = %83
%87 = load i32, i32* %6
%88 = icmp ne i32 %87, 0
br i1 %88, label %92, label %89
89: ; preds = %86, %83
%90 = load i32, i32* %7
%91 = icmp ne i32 %90, 0
br i1 %91, label %104, label %92
92: ; preds = %89, %86
%93 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%94 = load i32, i32* %5
%95 = icmp ne i32 %94, 0
br i1 %95, label %98, label %96
96: ; preds = %92
%97 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
br label %98
98: ; preds = %96, %92
%99 = load i32, i32* %8
%100 = icmp ne i32 %99, 0
br i1 %100, label %103, label %101
101: ; preds = %98
%102 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
br label %103
103: ; preds = %101, %98
br label %112
104: ; preds = %89
%105 = load i32, i32* %5
%106 = icmp ne i32 %105, 0
br i1 %106, label %109, label %107
107: ; preds = %104
%108 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
br label %111
109: ; preds = %104
%110 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %111
111: ; preds = %109, %107
br label %112
112: ; preds = %111, %103
br label %11
113: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@str = [19 x i8] c"This is leap year.\00"
@str.7 = [32 x i8] c"This is bulukulu festival year.\00"
@str.8 = [32 x i8] c"This is huluculu festival year.\00"
@str.9 = [26 x i8] c"This is an ordinary year.\00"
define i32 @main() {
%1 = alloca [100001 x i8]
%2 = getelementptr inbounds [100001 x i8], [100001 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %70
5: ; preds = %0, %67
%6 = phi i32 [ %11, %67 ], [ 0, %0 ]
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = call i32 @putchar(i32 10)
br label %10
10: ; preds = %8, %5
%11 = add nuw nsw i32 %6, 1
%12 = call i32 @strlen(i8* %2)
%13 = icmp sgt i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %55
16: ; preds = %10
%17 = zext i32 %12 to i64
br label %18
18: ; preds = %16, %18
%19 = phi i64 [ 0, %16 ], [ %44, %18 ]
%20 = phi i32 [ 0, %16 ], [ %37, %18 ]
%21 = phi i32 [ 0, %16 ], [ %43, %18 ]
%22 = phi i32 [ 0, %16 ], [ %40, %18 ]
%23 = phi i32 [ 0, %16 ], [ %34, %18 ]
%24 = phi i32 [ 0, %16 ], [ %31, %18 ]
%25 = mul nsw i32 %24, 10
%26 = getelementptr inbounds [100001 x i8], [100001 x i8]* %1, i64 0, i64 %19
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = add nsw i32 %28, -48
%30 = add nsw i32 %29, %25
%31 = srem i32 %30, 4
%32 = mul nsw i32 %23, 10
%33 = add nsw i32 %29, %32
%34 = srem i32 %33, 15
%35 = mul nsw i32 %20, 10
%36 = add nsw i32 %29, %35
%37 = srem i32 %36, 55
%38 = mul nsw i32 %22, 10
%39 = add nsw i32 %29, %38
%40 = srem i32 %39, 100
%41 = mul nsw i32 %21, 10
%42 = add nsw i32 %29, %41
%43 = srem i32 %42, 400
%44 = add nuw nsw i64 %19, 1
%45 = icmp eq i64 %44, %17
br i1 %45, label %46, label %18
46: ; preds = %18
%47 = icmp ne i32 %31, 0
%48 = icmp eq i32 %40, 0
%49 = select i1 %47, i1 true, i1 %48
%50 = icmp ne i32 %43, 0
%51 = select i1 %49, i1 %50, i1 false
br i1 %51, label %61, label %52
52: ; preds = %46
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%54 = icmp eq i32 %34, 0
br i1 %54, label %55, label %58
55: ; preds = %14, %52
%56 = phi i32 [ 0, %14 ], [ %37, %52 ]
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.8, i64 0, i64 0))
br label %58
58: ; preds = %55, %52
%59 = phi i32 [ %56, %55 ], [ %37, %52 ]
%60 = icmp eq i32 %59, 0
br i1 %60, label %64, label %67
61: ; preds = %46
%62 = icmp eq i32 %34, 0
%63 = select i1 %62, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.9, i64 0, i64 0)
br label %64
64: ; preds = %61, %58
%65 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @str.7, i64 0, i64 0), %58 ], [ %63, %61 ]
%66 = call i32 @puts(i8* dereferenceable(1) %65)
br label %67
67: ; preds = %64, %58
%68 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%69 = icmp eq i32 %68, 1
br i1 %69, label %5, label %70
70: ; preds = %67, %0
ret i32 0
}