#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);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n, i, v;
  int sum[7] = {0};
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &v);
    sum[i % 7] += v;
  }
  for (i = 0; i < 7; i++) {
    printf("%d\n", sum[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x1c,%edx
call   1040 <memset@plt>
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a9 <main+0x79>
lea    0xe87(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%eax
mov    $0x7,%esi
cltd
idiv   %esi
movslq %edx,%rax
add    -0x30(%rbp,%rax,4),%ecx
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1166 <main+0x36>
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    11dc <main+0xac>
movslq -0xc(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b0 <main+0x80>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x1c(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0xebe(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    11d1 <main+0xb1>
lea    0x10(%rsp),%rbp
xor    %ebx,%ebx
movabs $0x2492492492492493,%r12
49 92 24
lea    0xe95(%rip),%r14
lea    0xc(%rsp),%r15
mov    %rbx,%rax
mul    %r12
mov    %rbx,%rax
sub    %rdx,%rax
shr    %rax
add    %rdx,%rax
shr    $0x2,%rax
imul   $0xffffffffffffffe4,%rax,%r13
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
add    %eax,0x0(%rbp,%r13,1)
add    $0x1,%rbx
add    $0x4,%rbp
cmp    0x8(%rsp),%ebx
jl     1170 <main+0x50>
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%ebp
mov    0x18(%rsp),%ebx
mov    0x1c(%rsp),%r13d
mov    0x20(%rsp),%r12d
mov    0x24(%rsp),%r15d
mov    0x28(%rsp),%eax
mov    %eax,0x4(%rsp)
jmp    11e8 <main+0xc8>
movl   $0x0,0x4(%rsp)
xor    %r15d,%r15d
xor    %r12d,%r12d
xor    %r13d,%r13d
xor    %ebx,%ebx
xor    %ebp,%ebp
xor    %esi,%esi
lea    0xe14(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r13d,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r12d,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r15d,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    0x4(%rsp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [7 x i32]
store i32 0, i32* %1
%6 = bitcast [7 x i32]* %5 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %8
8: ; preds = %21, %0
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = srem i32 %15, 7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [7 x i32], [7 x i32]* %5, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = add nsw i32 %19, %14
store i32 %20, i32* %18
br label %21
21: ; preds = %12
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %8
24: ; preds = %8
store i32 0, i32* %3
br label %25
25: ; preds = %34, %24
%26 = load i32, i32* %3
%27 = icmp slt i32 %26, 7
br i1 %27, label %28, label %37
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [7 x i32], [7 x i32]* %5, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %28
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %25
37: ; preds = %25
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [7 x i32]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast [7 x i32]* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %40, label %25
10: ; preds = %40
%11 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%12 = load i32, i32* %11
%13 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 1
%14 = load i32, i32* %13
%15 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 2
%16 = load i32, i32* %15
%17 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 3
%18 = load i32, i32* %17
%19 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 4
%20 = load i32, i32* %19
%21 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 5
%22 = load i32, i32* %21
%23 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 6
%24 = load i32, i32* %23
br label %25
25: ; preds = %10, %0
%26 = phi i32 [ %24, %10 ], [ 0, %0 ]
%27 = phi i32 [ %22, %10 ], [ 0, %0 ]
%28 = phi i32 [ %20, %10 ], [ 0, %0 ]
%29 = phi i32 [ %18, %10 ], [ 0, %0 ]
%30 = phi i32 [ %16, %10 ], [ 0, %0 ]
%31 = phi i32 [ %14, %10 ], [ 0, %0 ]
%32 = phi i32 [ %12, %10 ], [ 0, %0 ]
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %32)
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %30)
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%39 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %26)
ret i32 0
40: ; preds = %0, %40
%41 = phi i32 [ %49, %40 ], [ 0, %0 ]
%42 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%43 = load i32, i32* %2
%44 = urem i32 %41, 7
%45 = zext i32 %44 to i64
%46 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = add nsw i32 %47, %43
store i32 %48, i32* %46
%49 = add nuw nsw i32 %41, 1
%50 = load i32, i32* %1
%51 = icmp slt i32 %49, %50
br i1 %51, label %40, label %10
}