// Calculando
#include <stdio.h>

int main() {
	int operacoes;
	int numero, soma;
	char sinal;
	int teste;
	int i;

	for (teste=1; scanf("%d", &operacoes)&&operacoes!=0; teste++) {
		scanf("%d", &soma);
		for (i=1; i<operacoes; i++) {
			scanf("%c", &sinal);
			scanf("%d", &numero);
			if (sinal=='+') {
				soma+=numero;
			} else {
				soma-=numero;
			}
		}
		printf("Teste %d\n%d\n\n", teste, soma);
	}

	return 0;
}

