#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);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main(void) {
  int num, pmax, psum, temp, st1, st2, i;
  while (1) {
    scanf("%d", &num);
    if (num == 0)
      break;
    psum = 0;
    for (i = 0; i < num; i++) {
      scanf("%d %d %d", &temp, &st1, &st2);
      st1 += st2;
      if (st1 > psum) {
        pmax = temp;
        psum = st1;
      }
    }
    printf("%d %d\n", pmax, psum);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1150 <main+0x30>
jmp    11cf <main+0xaf>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b8 <main+0x98>
lea    0xe8f(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11a5 <main+0x85>
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11aa <main+0x8a>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    115e <main+0x3e>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xed1(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
je     11dc <main+0xbc>
lea    0x14(%rsp),%r15
lea    0xc(%rsp),%r12
lea    0x10(%rsp),%rbx
jmp    118f <main+0x6f>
xchg   %ax,%ax
xor    %r13d,%r13d
lea    0xe9f(%rip),%rdi
mov    %ebp,%esi
mov    %r13d,%edx
call   1030 <printf@plt>
lea    0xe8b(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
je     11dc <main+0xbc>
test   %eax,%eax
jle    1160 <main+0x40>
xor    %r14d,%r14d
xor    %r13d,%r13d
jmp    11ab <main+0x8b>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r14d
cmp    0x8(%rsp),%r14d
jge    1163 <main+0x43>
lea    0xe4e(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
add    0x10(%rsp),%eax
mov    %eax,0xc(%rsp)
cmp    %r13d,%eax
jle    11a0 <main+0x80>
mov    0x14(%rsp),%ebp
mov    %eax,%r13d
jmp    11a0 <main+0x80>
xor    %eax,%eax
add    $0x18,%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 = [9 x i8] c"%d %d %d\00"
@.str.2 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
br label %9
9: ; preds = %0, %34
%10 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
br label %38
14: ; preds = %9
store i32 0, i32* %4
store i32 0, i32* %8
br label %15
15: ; preds = %31, %14
%16 = load i32, i32* %8
%17 = load i32, i32* %2
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %34
19: ; preds = %15
%20 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %5, i32* %6, i32* %7)
%21 = load i32, i32* %7
%22 = load i32, i32* %6
%23 = add nsw i32 %22, %21
store i32 %23, i32* %6
%24 = load i32, i32* %6
%25 = load i32, i32* %4
%26 = icmp sgt i32 %24, %25
br i1 %26, label %27, label %30
27: ; preds = %19
%28 = load i32, i32* %5
store i32 %28, i32* %3
%29 = load i32, i32* %6
store i32 %29, i32* %4
br label %30
30: ; preds = %27, %19
br label %31
31: ; preds = %30
%32 = load i32, i32* %8
%33 = add nsw i32 %32, 1
store i32 %33, i32* %8
br label %15
34: ; preds = %15
%35 = load i32, i32* %3
%36 = load i32, i32* %4
%37 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %35, i32 %36)
br label %9
38: ; preds = %13
ret i32 0
}

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