/*
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello world!\n");
return 0;
}
*/
/*
#include<stdio.h>
int main()
{
int n,i,j,k,map[4][4]= {0};
int a=0,b=0,c=0;
int at=0,bt=0,ct=0;
int ath=0,bth=0,cth=0;
scanf("%d",&n);
for(i=1; i<=n; i++)
{
for(j=1; j<=3; j++)
{
scanf("%d",&k);
map[k][j]++;
}
}
for(i=1; i<=3; i++)
{
for(j=1; j<=3; j++)
{
if(j==1)
{
a+=map[i][j]*i;
}
else if(j==2)
{
b+=map[i][j]*i;
}
else if(j==3)
{
c+=map[i][j]*i;
}
}
}
ath = map[3][1];
bth = map[3][2];
cth = map[3][3];
at = map[2][1];
bt = map[2][2];
ct = map[2][3];
if(a>b&&a>c)
{
printf("1 %d",a);
}
else if(b>a&&b>c)
{
printf("2 %d",b);
}
else if(c>a&&c>b)
{
printf("3 %d",c);
}
else if(b==c&&b>a)// b,c
{
if(bth>cth)
{
printf("2 %d",b);
}
else if(cth>bth)
{
printf("3 %d",c);
}
else
{
if(bt>ct)
{
printf("2 %d",b);
}
else if(ct>bt)
{
printf("3 %d",c);
}
else
{
printf("0 %d",b);
}
}
}
else if(a==b&&a>c)// a,b
{
if(ath>bth)
{
printf("1 %d",a);
}
else if(bth>ath)
{
printf("2 %d",b);
}
else
{
if(at>bt)
{
printf("1 %d",a);
}
else if(bt>at)
{
printf("2 %d",b);
}
else
{
printf("0 %d",a);
}
}
}
else if(a>b&&a==c)// a,c
{
if(ath>cth)
{
printf("1 %d",a);
}
else if(cth>ath)
{
printf("3 %d",c);
}
else
{
if(at>ct)
{
printf("1 %d",a);
}
else if(ct>at)
{
printf("3 %d",c);
}
else
{
printf("0 %d",a);
}
}
}
else if(a==b&&b==c)
{
if(ath>bth&&ath>cth)
{
printf("1 %d",a);
}
else if(bth>ath&&bth>cth)
{
printf("2 %d",b);
}
else if(cth>ath&&cth>bth)
{
printf("3 %d",c);
}
else
{
if(at>bt&&at>ct)
{
printf("1 %d",a);
}
else if(bt>at&&bt>ct)
{
printf("2 %d",b);
}
else if(ct>at&&ct>bt)
{
printf("3 %d",c);
}
else
{
printf("0 %d",a);
}
}
}
return 0;
}
6
1 2 3
3 1 2
2 3 1
1 2 3
3 1 2
2 3 1
0 12 (1 12)
*/