You are asking to write a calculator which can do the following operations:+, -, *, /, ^ and ().

All input numbers are integers and no floating numbers appeared during the calculation.

Submit: 197 Solved: 46

[Submit][Status][Web Board]

You are asking to write a calculator which can do the following operations:+, -, *, /, ^ and ().

All input numbers are integers and no floating numbers appeared during the calculation.

The first line is the number of test cases, T (1 <= T <= 10)

For each test case, there is only one line with the expression. The input is always legal.

The length of expression will not exceed 50. And all median results don’t exceed 1000.

All input numbers are positive. All input expressions follow the rules in Math.

Print
one integer in a single line for each test case, the result after calculation.

```
1
5+6*3-2/2+1
```

```
23
```

Bonus problem