process.stdin.resume();
process.stdin.setEncoding('utf8');

class Score {
    constructor(id, score1, score2, score3) {
        this.id = id;
        this.score1 = score1;
        this.score2 = score2;
        this.score3 = score3;
    }
    comparison(scores) {

        let score1 = this.score1;
        let score2 = this.score2;
        let score3 = this.score3;

        scores.forEach(s => {
            if (this.id !== s.id) {

                if (this.score1 === s.score1) {
                    score1 = 0;
                }
                if (this.score2 === s.score2) {
                    score2 = 0;
                }
                if (this.score3 === s.score3) {
                    score3 = 0;
                }
            }
        });

        return new Score(this.id, score1, score2, score3);
    }

    sum() {
        return this.score1 + this.score2 + this.score3;
    }
}



process.stdin.on('data', function (chunk) {
    const n = chunk.toString() // 文字列化する
        .split("\n") // \nで分割
        .filter(x => x !== "");
    const [count, ...inputScore] = n;
    let scoreAll = [];
    const all = inputScore.map(x => x.split(" "));

    for (let i = 0; i < inputScore.length; i++) {
        var [score1, score2, score3] = all[i];
        scoreAll.push(new Score(i, Number(score1), Number(score2), Number(score3)));
    }

    const changed = scoreAll.map(x => x.comparison(scoreAll));

    changed.forEach(x => {
        console.log(x.sum());
    });
});
