#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 *, double);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int j = 0, i = 0, c = 0, b = 1;
  double a, total = 0;
  char word[2];
  scanf(" %s", &word);
  for (i = 0; i < 12; i++) {
    for (j = 0; j < 12; j++) {
      if (c < b) {
        scanf("%lf", &a);
        c++;
      } else {
        scanf("%lf", &a);
        total += a;
        c++;
      }
    }
    c = 0;
    b++;
  }
  if (word[0] == 'S') {
    printf("%.1lf\n", total);
  } else {
    printf("%.1lf\n", total / 66);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    0xeae(%rip),%rdi
lea    -0x2a(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xc,-0xc(%rbp)
jge    120e <main+0xee>
movl   $0x0,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
jge    11f0 <main+0xd0>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11b3 <main+0x93>
lea    0xe72(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11dd <main+0xbd>
lea    0xe52(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11e2 <main+0xc2>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117d <main+0x5d>
movl   $0x0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116c <main+0x4c>
movsbl -0x2a(%rbp),%eax
cmp    $0x53,%eax
jne    1231 <main+0x111>
movsd  -0x28(%rbp),%xmm0
lea    0xde9(%rip),%rdi
call   1030 <printf@plt>
jmp    124e <main+0x12e>
movsd  -0x28(%rbp),%xmm0
movsd  0xdc2(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xdc7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xed9(%rip),%rdi
lea    0x1e(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    $0x1,%ebp
xorpd  %xmm0,%xmm0
lea    0xec1(%rip),%r14
lea    0x10(%rsp),%rbx
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0x1,%ebp
jbe    1260 <main+0x140>
cmp    $0x2,%ebp
je     1272 <main+0x152>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0x3,%ebp
jbe    1291 <main+0x171>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0x4,%ebp
je     12b0 <main+0x190>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0x5,%ebp
jbe    12cf <main+0x1af>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0x6,%ebp
je     12ee <main+0x1ce>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0x7,%ebp
jbe    130d <main+0x1ed>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0x8,%ebp
je     132c <main+0x20c>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0x9,%ebp
jbe    134b <main+0x22b>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0xa,%ebp
je     136a <main+0x24a>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0xb,%ebp
jbe    1389 <main+0x269>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
jmp    13a2 <main+0x282>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x1,%ebp
cmp    $0xd,%ebp
jne    1150 <main+0x30>
cmpb   $0x53,0x1e(%rsp)
je     13bd <main+0x29d>
divsd  0xc43(%rip),%xmm0
lea    0xc4c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c" %s\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [7 x i8] c"%.1lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca [2 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 1, i32* %5
store double 0.000000e+00, double* %7
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), [2 x i8]* %8)
store i32 0, i32* %3
br label %10
10: ; preds = %39, %0
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 12
br i1 %12, label %13, label %42
13: ; preds = %10
store i32 0, i32* %2
br label %14
14: ; preds = %33, %13
%15 = load i32, i32* %2
%16 = icmp slt i32 %15, 12
br i1 %16, label %17, label %36
17: ; preds = %14
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %6)
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %32
25: ; preds = %17
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %6)
%27 = load double, double* %6
%28 = load double, double* %7
%29 = fadd double %28, %27
store double %29, double* %7
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %32
32: ; preds = %25, %21
br label %33
33: ; preds = %32
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
br label %14
36: ; preds = %14
store i32 0, i32* %4
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %39
39: ; preds = %36
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 1
store i32 %41, i32* %3
br label %10
42: ; preds = %10
%43 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 83
br i1 %46, label %47, label %50
47: ; preds = %42
%48 = load double, double* %7
%49 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %48)
br label %54
50: ; preds = %42
%51 = load double, double* %7
%52 = fdiv double %51, 6.600000e+01
%53 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %52)
br label %54
54: ; preds = %50, %47
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c" %s\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [7 x i8] c"%.1lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca [2 x i8]
%3 = bitcast double* %1 to i8*
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), [2 x i8]* %2)
br label %6
6: ; preds = %0, %96
%7 = phi double [ 0.000000e+00, %0 ], [ %97, %96 ]
%8 = phi i32 [ 1, %0 ], [ %98, %96 ]
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%10 = icmp ugt i32 %8, 1
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
br i1 %10, label %15, label %12
12: ; preds = %6
%13 = load double, double* %1
%14 = fadd double %7, %13
br label %17
15: ; preds = %6
%16 = icmp eq i32 %8, 2
br i1 %16, label %17, label %22
17: ; preds = %15, %12
%18 = phi double [ %14, %12 ], [ %7, %15 ]
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%20 = load double, double* %1
%21 = fadd double %18, %20
br label %25
22: ; preds = %15
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%24 = icmp ugt i32 %8, 3
br i1 %24, label %30, label %25
25: ; preds = %22, %17
%26 = phi double [ %21, %17 ], [ %7, %22 ]
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%28 = load double, double* %1
%29 = fadd double %26, %28
br label %33
30: ; preds = %22
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%32 = icmp eq i32 %8, 4
br i1 %32, label %33, label %38
33: ; preds = %30, %25
%34 = phi double [ %29, %25 ], [ %7, %30 ]
%35 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%36 = load double, double* %1
%37 = fadd double %34, %36
br label %41
38: ; preds = %30
%39 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%40 = icmp ugt i32 %8, 5
br i1 %40, label %46, label %41
41: ; preds = %38, %33
%42 = phi double [ %37, %33 ], [ %7, %38 ]
%43 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%44 = load double, double* %1
%45 = fadd double %42, %44
br label %49
46: ; preds = %38
%47 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%48 = icmp eq i32 %8, 6
br i1 %48, label %49, label %54
49: ; preds = %46, %41
%50 = phi double [ %45, %41 ], [ %7, %46 ]
%51 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%52 = load double, double* %1
%53 = fadd double %50, %52
br label %57
54: ; preds = %46
%55 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%56 = icmp ugt i32 %8, 7
br i1 %56, label %62, label %57
57: ; preds = %54, %49
%58 = phi double [ %53, %49 ], [ %7, %54 ]
%59 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%60 = load double, double* %1
%61 = fadd double %58, %60
br label %65
62: ; preds = %54
%63 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%64 = icmp eq i32 %8, 8
br i1 %64, label %65, label %70
65: ; preds = %62, %57
%66 = phi double [ %61, %57 ], [ %7, %62 ]
%67 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%68 = load double, double* %1
%69 = fadd double %66, %68
br label %73
70: ; preds = %62
%71 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%72 = icmp ugt i32 %8, 9
br i1 %72, label %78, label %73
73: ; preds = %70, %65
%74 = phi double [ %69, %65 ], [ %7, %70 ]
%75 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%76 = load double, double* %1
%77 = fadd double %74, %76
br label %81
78: ; preds = %70
%79 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%80 = icmp eq i32 %8, 10
br i1 %80, label %81, label %86
81: ; preds = %78, %73
%82 = phi double [ %77, %73 ], [ %7, %78 ]
%83 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%84 = load double, double* %1
%85 = fadd double %82, %84
br label %89
86: ; preds = %78
%87 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%88 = icmp ugt i32 %8, 11
br i1 %88, label %94, label %89
89: ; preds = %81, %86
%90 = phi double [ %85, %81 ], [ %7, %86 ]
%91 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%92 = load double, double* %1
%93 = fadd double %90, %92
br label %96
94: ; preds = %86
%95 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
br label %96
96: ; preds = %94, %89
%97 = phi double [ %7, %94 ], [ %93, %89 ]
%98 = add nuw nsw i32 %8, 1
%99 = icmp eq i32 %98, 13
br i1 %99, label %100, label %6
100: ; preds = %96
%101 = load i8, i8* %4
%102 = icmp eq i8 %101, 83
%103 = fdiv double %97, 6.600000e+01
%104 = select i1 %102, double %97, double %103
%105 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %104)
ret i32 0
}