import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
for (int k = 0; k < 3; k++) {
int input = in.nextInt();
arr[i] += input;
}
}
for (int j = 0; j < arr.length - 1; j++) {
for (int k = 0; k < arr.length - j - 1; k++) {
if (arr[j] > arr[j + 1]) {
int t = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = t;
}
}
}
for (int i = 0; i < arr.length; i++) {
System.out.println(arr[arr.length-i-1]);
}
}
}