import java.util.Scanner;
import java.util.Arrays;
import java.lang.Comparable;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        int n = in.nextInt();
        std[] stds = new std[n];
        for (int i=0; i<n; i++) { // 注意 while 处理多个 case
            String name = in.next();
            int cn = in.nextInt();
            int mt = in.nextInt();
            int en = in.nextInt();
            stds[i] = new std(name, cn, mt, en);
        }
        Arrays.sort(stds);
        System.out.println(stds[0]);
    }
}

class std implements Comparable<std> {
    String std_name;
    int point_cn, point_mt, point_en;
    public std(String name, int cn, int mt, int en) {
        std_name = name;
        point_cn = cn;
        point_mt = mt;
        point_en = en;
    }

    @Override
    public int compareTo(std other) {
        // Integer.compare 可以安全地处理所有int值
        return Integer.compare(other.point_cn+other.point_en+other.point_mt, this.point_cn+this.point_en+this.point_mt);
    }

    @Override
    public String toString() {
        return std_name+" "+point_cn+" "+point_mt+" "+point_en;
    }
}