BEGIN	{
	i= 0
	}

$2 == "ENTER"	{
	stack[i++]= $1
	}

$1 == "+"	{
	result= stack[i-2] + stack[i-1]
	i-= 2
	stack[i++]= result
	}

$1 == "-"	{
	result= stack[i-2] - stack[i-1]
	i-= 2
	stack[i++]= result
	}

$1 == "*"	{
	result= stack[i-2] * stack[i-1]
	i-= 2
	stack[i++]= result
	}

$1 == "/"	{
	result= stack[i-2] / stack[i-1]
	i-= 2
	stack[i++]= result
	}

	{
	for (j= i-1; j >= 0; j--)
	  printf ("%d ", stack[j])
	printf ("\n")
	}

END	{
	print stack[0]
	}
