Go: package main

import (
	"bufio"
	"fmt"
	"go/token"
	"go/types"
	"os"
	"strconv"
	"strings"
)

func main() {
	stdin := bufio.NewScanner(os.Stdin)
	stdin.Scan()
	n, _ := strconv.Atoi(stdin.Text())
	for i := 0; i < n; i++ {
		stdin.Scan()
		exp := strings.TrimRight(stdin.Text(), "=")
		res, _ := types.Eval(token.NewFileSet(), nil, token.NoPos, exp)
		fmt.Println(res.Value)
	}
}

Python: #n=int(input())

def lastfind(s,x):
    n=len(s)
    s_rev=s[::-1]
    t=s_rev.find(x)
    return n-t-1
def doublefind(s,x,y):
    if x in s:
        p=lastfind(s,x)
    else:
        p=-1
    if y in s:
        q=lastfind(s,y)
    else:
        q=-1
    
    if p==-1 and q==-1:
        return 0
    elif p<=q:
        return [q,y]
    else:
        return [p,x]

def calculator(s):
    if s=="":
        return 0
    
    try:
        return int(s)
    except:
        try:
            x=doublefind(s,"+","-")
            if x[1]=="+":
                return calculator(s[:x[0]:])+calculator(s[x[0]+1::])
            else:
                return calculator(s[:x[0]:])-calculator(s[x[0]+1::])
        except:
            x=doublefind(s,"*","/")
            if x[1]=="*":
                return calculator(s[:x[0]:])*calculator(s[x[0]+1::])
            else:
                return calculator(s[:x[0]:])/calculator(s[x[0]+1::])

def calc(s):
    while "(" in s:
        closec=s.find(")")
        openc=lastfind(s[:closec:],"(")
        s=s[:openc:]+str(calculator(s[openc+1:closec:]))+s[closec+1::]
        print (s)
    return calculator(s)
        
n=int(input())
for count in range(n):
    s=input()
    print(int(calc(s[:-1:])))

Python: #!/usr/bin/python3

import re
n = int(input())
for _ in range(n):
    print(eval(re.sub(r'(\d+/\d+)', r'int(\1)', input()[0:-1])))

Python: import sys
#from me.io import dup_file_stdin

#@dup_file_stdin
def solve():
    for _ in range(int(sys.stdin.readline())):
        print(eval(sys.stdin.readline()[:-1].strip("=").replace("/","//")))
 
solve()

Python: n=int(input())
for i in range(n):
    s=input()
    print(int(eval(s[0:-1])))

Python: n = int(input())
for _ in range (n):
    print(eval(input().rstrip('=')))

Python: #!/usr/bin/env python
#-*- coding:utf-8 -*-
import sys

def main():
	n = input()
	for i in xrange(n):
		line = raw_input()
		exec("print %s" % line[:-1])
	return 0

if __name__ == '__main__':
	sys.exit(main())

Python: import re
class c:
	def __str__(self):
		return str(self.x)
	def __init__(self,value):
		self.x=value
	def __add__(self,value):
		return c(self.x+value.x)
	def __sub__(self,value):
		return c(self.x-value.x)
	def __mul__(self,value):
		return c(self.x*value.x)
	def __truediv__(self,value):
		return c(int(self.x/value.x))
n=int(input())
for i in range(n):
	s=input()[:-1]
	s=re.sub(r'(\d+)',r'c(\1)',s)
	print(eval(s))

Python: [print(int(eval(input()[:-1]))) for i in range(int(input()))]

Python: R={"*":2,"/":2,"+":1,"-":1,"(":0,")":0}
for _ in[0]*int(input()):
 L=[];t=''
 for e in input()[:-1]:
  if e.isdigit():t+=e
  else:
   if t:L+=[t];t=''
   L+=e
 if t:L+=[t]
 P,S=[],[]
 for i in L:
  if"("==i:S+=i
  elif")"==i:
   while"("!=S[-1]:P+=S.pop()
   S.pop()
  elif i in R:
   while S and R[S[-1]]>=R[i]:P+=S.pop()
   S+=i
  else:P+=[i]
 while S:P+=S.pop()
 for x in P:
  S+=[str(int(eval(S.pop(-2)+x+S.pop())))if x in"+-*/"else x]
 print(*S)

Python: #n=int(input())

def lastfind(s,x):
    n=len(s)
    s_rev=s[::-1]
    t=s_rev.find(x)
    return n-t-1
def doublefind(s,x,y):
    if x in s:
        p=s.find(x)
    else:
        p=len(s)+10
    if y in s:
        q=s.find(y)
    else:
        q=len(s)+10
    
    if p<=q and p<len(s)+5:
        return [p,x]
    elif q<len(s)+5:
        return [q,y]
    else:
        return 0

def calculator(s):
    if s=="":
        return 0
    
    try:
        return int(s)
    except:
        try:
            x=doublefind(s,"+","-")
            if x[1]=="+":
                return calculator(s[:x[0]:])+calculator(s[x[0]+1::])
            else:
                return calculator(s[:x[0]:])-calculator(s[x[0]+1::])
        except:
            x=doublefind(s,"*","/")
            if x[1]=="*":
                return calculator(s[:x[0]:])*calculator(s[x[0]+1::])
            else:
                return calculator(s[:x[0]:])/calculator(s[x[0]+1::])
def remove_brackets(s):
    if s[0]=="(" and s[-1]==")":
        return s[1:-1:]
    else:
        return s
def calc(s):
    while "(" in s:
        closec=s.find(")")
        openc=lastfind(s[:closec:],"(")
        s=s[:openc:]+str(calculator(s[openc+1:closec:]))+s[closec+1::]
    return calculator(s)
        
n=int(input())
for count in range(n):
    s=input()
    print(int(calc(s[:-1:])))

Python: n=int(input())
for i in range(n):
	a=input()
	print(eval(a[:len(a)-1]))

Python: import sys

while True:
    line = raw_input()
    if line == '':
        break

    for i in range(int(line)):
        a = eval(raw_input().replace('/', '//')[:-1])
        sys.stderr.write(str(a))

Python: def ReversePolishNotation(string):

    priority = {"Sentinel": 0, "(": 0, "+": 1, "-": 1, "*": 2, "/": 2}

    stack = []
    signStack = ["Sentinel"]

    for item in string[:-1]:
        if item == "(":
            signStack.append(item)
        elif item == ")":
            while signStack[-1] != "(":
                stack.append(signStack.pop())
            signStack.pop()
        else:
            if item in priority.keys():
                if priority[signStack[-1]] < priority[item]:
                    signStack.append(item)
                else:
                    top = signStack.pop()
                    stack.append(top)
                    signStack.append(item)
            else:
                stack.append(item)

    while signStack[-1] != "Sentinel":
        stack.append(signStack.pop())

    return stack


def Calculate(formulaList):

    signs = ["+", "-", "*", "/"]

    stack = []

    for item in formulaList:

        if item not in signs:
            stack.append(item)
        else:
            num1 = 0
            num2 = 0

            result = 0

            if item == "+":
                result = num2 + num1
            elif item == "-":
                result = num2 - num1
            elif item == "*":
                result = num2 * num1
            else:
                result = num2 / num1

            stack.append(result)

    return int(stack[0])


inputCount = int(input())

for lp in range(inputCount):
    formula = input()

    rpn = ReversePolishNotation(formula)
    answer = Calculate(rpn)

    print(answer)

Python: T = int(input())
for tc in range(0,T) :
	print(input().strip("="))

Python: def ReversePolishNotation(string):

    priority = {"Sentinel": 0, "(": 0, "+": 1, "-": 1, "*": 2, "/": 2}

    stack = []
    signStack = ["Sentinel"]

    for item in string[:-1]:
        if item == "(":
            signStack.append(item)
        elif item == ")":
            while signStack[-1] != "(":
                stack.append(signStack.pop())
            signStack.pop()
        else:
            if item in priority.keys():
                if priority[signStack[-1]] < priority[item]:
                    signStack.append(item)
                else:
                    top = signStack.pop()
                    stack.append(top)
                    signStack.append(item)
            else:
                stack.append(item)

    while signStack[-1] != "Sentinel":
        stack.append(signStack.pop())

    return stack


inputCount = int(input())

for lp in range(inputCount):
    formula = input()

    rpn = ReversePolishNotation(formula)

    print(rpn)

Python: while True:
    try:
        for i in range(int(input())):
            print(str(int(eval(input().replace('=', '')))))
    except:
        break