import java.util.Scanner;
public class Test244 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int N,a,b,c,result;
while(sc.hasNext())
{
N=sc.nextInt();
for(int i=0;i<N;i++)
{
a=sc.nextInt();
b=sc.nextInt();
c=sc.nextInt();
switch(a)
{
case 1:
result=b+c;
System.out.printf("%d\n",result);
break;
case 2:
result=b-c;
System.out.printf("%d\n",result);
break;
case 3:
result=b*c;
System.out.printf("%d\n",result);
break;
case 4:
result=b/c;
System.out.printf("%d\n",result);
break;
}
}
}
}
}
import java.util.Scanner;
public class Test244 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int N,a,b,c,result;
while(sc.hasNext())
{
N=sc.nextInt();
for(int i=0;i<N;i++)
{
a=sc.nextInt();
b=sc.nextInt();
c=sc.nextInt();
switch(a)
{
case 1:
result=b+c;
System.out.printf("%d\n",result);
break;
case 2:
result=b-c;
System.out.printf("%d\n",result);
break;
case 3:
result=b*c;
System.out.printf("%d\n",result);
break;
case 4:
result=b/c;
System.out.printf("%d\n",result);
break;
}
}
}
}
}
long?