
a = (1..gets.to_i).inject([]) { |a, i| a << gets.split.map(&:to_i) }
b = (1..3).inject([]) { |b, i| b << Array.new(101, 0) }
3.times { |i| a.size.times { |j| b[i][a[j][i]] += 1 } }
a.size.times { |i| puts (0..2).inject(0) { |sm, j|
    sm + (b[j][a[i][j]] > 1 ? 0 : a[i][j]) } }