Process the expression#5981

Process the expression

1 second
64 megabytes
Hard

Calculate the derivative of the given function at specified points.

The function is provided as a single-line expression in infix notation, without spaces. It may include binary operations + - * ^ (exponentiation), parentheses, single-digit positive integers, and the variable .

Input

The first line of the input contains the functional expression. The second line lists one or more integers, representing the values of where the derivative should be evaluated.

The expression's length does not exceed characters. The expression is guaranteed to be valid, and the results will fit within the standard integer range. The values of are also within the standard integer range.

Output

The output should have the same number of lines as there are values of . Each line should display the derivative's value of the expression at the corresponding .

Examples

Example 1

Loading
Loading