#include<stdio.h>
#define N 100

int main(int argc, char *argv[]){
  int i,j,a[N],b,c,d;

  for(i=0;i<d-1;i++){
    for(j=0;j<2;j++){
      scanf("%d%d",a[j]a[j+1]);
    }
  if(scanf("%d",c)== +){
    d = a[0] + a[1];
  }
  if(scanf("%d",c)== -){
    d = a[0] - a[1];
  }