/*
#include <stdio.h>
int memo[15][15] = {};
int SuperSum(int k, int n)
{
int sum=0;
if(k==0){
return memo[k][n] = n;
}
if(memo[k][n] != 0){
return memo[k][n];
}
for(int i=1; i<=n; i++){
sum = sum + SuperSum(k-1, i);
}
return memo[k][n] = sum;
}
int main(void)
{
int k, n;
while( scanf("%d %d", &k, &n) != EOF){
printf("%d\n", SuperSum(k, n));
}
return 0;
}
*/
/*
#include <stdio.h>
int memo[51][51] = {};
int pasc(int r, int c)
{
if(memo[r][c] != 0){
return memo[r][c];
}
if(r==1){
return memo[r][c] = 1;
}
if(c==1){
return memo[r][c] = 1;
}
return memo[r][c] = pasc(r-1, c)%100000000+pasc(r, c-1)%100000000;
}
int main(void)
{
int r, c;
scanf("%d %d", &r, &c);
printf("%d\n", pasc(r, c)%100000000);
return 0;
}
*/
/*
#include <stdio.h>
int memo[100001]={};
int stair(int n)
{
if(memo[n] != 0){
return memo[n];
}
if(n == 1){
return memo[n] = 1;
}
if(n == 2){
return memo[n] = 2;
}
if(n==3){
return memo[n] = 4;
}
return memo[n] = stair(n-1)%1000 + stair(n-2)%1000 + stair(n-3)%1000;
}
int main(void)
{
int n;
scanf("%d", &n);
printf("%d\n", stair(n)%1000);
return 0;
}
*/
/*
#include <stdio.h>
int memo[201]={};
int pib(int n)
{
if(memo[n] != 0){
return memo[n];
}
if(n==1){
return memo[n] = 1;
}
if(n==2){
return memo[n] = 1;
}
return memo[n] = pib(n-1)%10009 + pib(n-2)%10009;
}
int main(void)
{
int n;
scanf("%d", &n);
printf("%d\n", pib(n)%10009);
return 0;
}
구조체 struct : 사용자 정의 자료형
ex) 학생 100명의 나이(정수)와 성적(char)을 관리
int age[100];
char grade[100];
*/
/*
#include <stdio.h>
typedef struct
{
char name[10];
int age;
char grade;
}student;
int main(){
student arr[101];
// arr[1]과 arr[10]을 교환
arr[0].age = 10;
scanf("%d",&arr[0].age);
}
*/
/*
#include <stdio.h>
typedef struct
{
int rank;
int score;
}student;
int main(void)
{
student arr[201];
int n, i, j, temp;
scanf("%d", &n);
for(i=1; i<=n; i++){
scanf("%d", &arr[i].score);
arr[i].rank = 1;
}
for(i=1; i<=n; i++){
for(j=1; j<=n; j++){
if(i != j){
if(arr[i].score<arr[j].score){
arr[i].rank++;
}
}
}
}
for(i=1; i<=n; i++){
printf("%d %d\n", arr[i].score, arr[i].rank);
}
return 0;
}
*/
/*
#include <stdio.h>
typedef struct
{
int country, num, score, rank;
}student;
int main(void)
{
student arr[101];
int n, i, j, count[101] = {}, p=0;
scanf("%d", &n);
for(i=1; i<=n; i++){
scanf("%d %d %d", &arr[i].country, &arr[i].num, &arr[i].score);
arr[i].rank=1;
}
for(i=1; i<=n; i++){
for(j=1; j<=n; j++){
if(i != j){
if(arr[i].score < arr[j].score){
arr[i].rank++;
}
}
}
}
for(j=1; j<=n; j++){
for(i=1; i<=n; i++){
if(arr[i].rank == j){
if(count[arr[i].country]!=2){
printf("%d %d\n", arr[i].country, arr[i].num);
count[arr[i].country]++;
p++;
}
}
if(p==3){
return 0;
}
}
}
return 0;
}
*/
/*
#include <stdio.h>
#include <string.h>
typedef struct
{
char name[11];
int score[4], rank[4];
}student;
int main(void)
{
student arr[101];
int n, i, j, k;
scanf("%d", &n);
for(i=1; i<=n; i++){
scanf("%s %d %d %d", arr[i].name, &arr[i].score[1], &arr[i].score[2], &arr[i].score[3]);
arr[i].rank[1] = 1;
arr[i].rank[2] = 1;
arr[i].rank[3] = 1;
}
for(i=1; i<=n; i++){
for(j=1; j<=n; j++){
if(i != j){
for(k=1; k<=3; k++){
if(arr[i].score[k] < arr[j].score[k]){
arr[i].rank[k]++;
}
}
}
}
}
for(i=1; i<=n ;i++){
if(arr[i].rank[1] == 1){
printf("%s %d %d\n", arr[i].name, arr[i].rank[2], arr[i].rank[3]);
}
}
return 0;
}
*/
/*
#include <stdio.h>
int main(void)
{
int n, i, input_1=0, input_2=0, s, repeat=0, score=0;
scanf("%d", &n);
for(i=1; i<=n; i++){
scanf("%d", &input_2);
if(input_1==1 && input_2==1){
repeat++;
}else{
repeat = 0;
}
if(input_2==1){
score=score+repeat+1;
}
input_1=input_2;
}
printf("%d\n", score);
return 0;
}
*/
#include <stdio.h>
int main(void)
{
int n, arr[5][4]={}, i, a,b,c;
scanf("%d", &n);
for(i=1; i<=n; i++){
scanf("%d %d %d", &a, &b, &c);
arr[a][1]++;
arr[b][2]++;
arr[c][3]++;
arr[4][1] = arr[4][1]+a;
arr[4][2] = arr[4][2]+b;
arr[4][3] = arr[4][3]+c;
}
return 0;
}